Select to view content in your preferred language

Publishing GP Model with "Manage Map Server Cache Tiles" Tool fails

2351
7
11-21-2012 06:12 AM
MapEnglish
Frequent Contributor
Hi:

When I run the Analyzer it complains about:

Data source used by Model RecreateMapTiles2 is not registered with the server and will be copied to the server: GIS Servers/arcgis on ctmnr03_6080 (admin)/GFX/Moncton.MapServer

And the model does not publish. The underlying data that the map service connects to is registered with the server.

Any thoughts as to how I can get this published would be appreciated.

Many thanks,
Matt English
Esri Canada
Tags (2)
0 Kudos
7 Replies
KevinHibma
Esri Regular Contributor
Without testing this - you're saying it doesn't publish? (fails when you actually push Publish?)

We have fixed analyzer messages for other service types throwing misleading messages that data will be copied (namely ImageServices and Geodata Services coming up in SP2). But thats it, just the message said data would be copied, when in fact its just the connection file being copied (no harm there). So in the end they publish correctly.

If it isnt publishing, can you save your connection file into your working directory beside the model, use that reference inside your model and then register that folder with the data store. Any luck?
0 Kudos
MapEnglish
Frequent Contributor
Correct. It does not publish, even with your suggested workflow below. Attached is the Model.

Thanks, Matt
0 Kudos
KevinHibma
Esri Regular Contributor
I see.

Hmmm...At first thought I not entirely sure the cache tools are meant to be published as a service. (I'll have to check with a couple people). Regardless there should be a better experience than it failing in publish.

I'm guessing you want to on-demand supply an area of interest and update that cache?
I can offer you the workaround of simply using the caching tools which already exist as a service in the System folder.
You can either consume the service directly or bring it into a local model and set parameters as required.
0 Kudos
MapEnglish
Frequent Contributor
I like the System Caching tools approach. When I try and run that tool from ArcMap for one scale level I get the following:

Server Messages
Submitted.
Executing...
Executing (Manage Map Cache Tiles): ManageMapCacheTiles http://localhost:6080/arcgis/rest/services/GFX/Moncton/MapServer 9027.977411 2 RECREATE_ALL_TILES # # "Feature Set"
Start Time: Wed Nov 21 13:38:49 2012
ERROR 999999: Error executing function.
ArcGIS Server requires a service type (ParentType) and a server object extension type (Type).
Failed to execute (Manage Map Cache Tiles).
Failed at Wed Nov 21 13:38:49 2012 (Elapsed Time: 0.00 seconds)
Failed.

Thoughts?
Matt
0 Kudos
MapEnglish
Frequent Contributor
The end result is that, from a JavaScript API app, I want to supply an on-demand gdb featureclass to update a tile cache.

matt
0 Kudos
KevinHibma
Esri Regular Contributor
Matt,

As I deal more with GP as a whole than specific tools (like caching), I asked around and confirmed that the best way to use the caching tools is to consume the built in ones from Desktop which call the GP-Service based caching tools.
Alternatively its ok to consume the services directly from the end point like you're doing, you just dont get as good a user experience. However, this leads to your next problem - passing the appropriate parameters "by hand" off to the caching service

That said, the error you're getting is because how the published caching service expects the input for MapService. When consuming it in ArcMap you need to pass it a real connection file, but when consuming it in REST you want to pass a string in the notation :  Moncton:MapServer

However, your end goal of sending a GDB of featureclasses with extents is going to be troublesome from a webapp.
You'll have to handle uploading a zipped up fGDB through the webapp, then have server side code (probably a GP service) to unzip that, search through the fGDB and then pass the FC to the GP Caching service.
Also keep in mind that the Caching tools are security enabled by default. So any web application you create would have to handle authentication. (not just any user can fire up the site and do cache management)

I've also been told that some caching improvements have been targeted for SP2 in terms of cache management inside Manager. These improvements sort of cross into the goal of your project. SP2 is still a little ways off, so I cant commit anything, just that its on the list of things we'd like to do.

Help links for reference:
http://resources.arcgis.com/en/help/main/10.1/#/Creating_a_map_cache/0154000005nw000000/
http://resources.arcgis.com/en/help/main/10.1/#/Ways_to_add_tiles_to_a_cache/0154000002rr000000/         
http://resources.arcgis.com/en/help/main/10.1/index.html#//00540000000p000000
0 Kudos
MapEnglish
Frequent Contributor
The only thing I could get to publish was a python script tool, with the admin connection file to the map service in a registered data store:

# Import arcpy module
import arcpy

# Script arguments
Moncton_BuildingFootprintsDeltas = arcpy.GetParameterAsText(0)
if Moncton_BuildingFootprintsDeltas == '#' or not Moncton_BuildingFootprintsDeltas:
    Moncton_BuildingFootprintsDeltas = "D:\\Data\\Moncton\\Moncton_BACKUP.gdb\\Moncton_BuildingFootprintsDeltas" # provide a default value if unspecified

# Local variables:
Output_Map_Service_URL = Moncton_BuildingFootprintsDeltas
Moncton_MapServer = "D:\\Data\\Moncton\\arcgis on ctmnr03_6080 (admin)\\GFX/Moncton.MapServer"

# Process: Manage Map Server Cache Tiles
arcpy.ManageMapServerCacheTiles_server(Moncton_MapServer, "9027.977411;4513.988705;2256.994353;1128.497176", "RECREATE_ALL_TILES", "2", Moncton_BuildingFootprintsDeltas, "-7232467.31199099 5782907.54217863 -7190044.76129278 5809736.93910669", "WAIT")

This GP service is executed after a prior service creates Area of Interest polygons so I'm not really having to provide the featureclass from the JavaScript app itself; everything is happening on the server in sequence.

Thanks, Matt
0 Kudos