Select to view content in your preferred language

Linking pre-calculated cache to sddraft to a publishing map service on a standalone server

319
0
06-02-2023 05:11 AM
NicolasRojas
New Contributor III

Hello,

I am trying to replicate the workflow of publishing a WMTS service that has cache from ArcGISPro with python (outside of ArcGIS pro environment / standalone script). The issue is that I have pre-calculated cache available for my service and would like to include it programmatically. The precalculated cache folder name starts with the server folder followed by the map service name as such: {folder}_{map service name}. I've added the precalculated cache to a server folder that i've linked in the manager site tab as type: Cache (see image below).

NicolasRojas_0-1685707487465.png

In pro:

- I've connected to my standalone server and did right click -> publish.

- In the publish map properties I check the box 'Use existing cache' and I get the message that the cache folder with the service name was found. 👍

All good. In the server's manager the cache is there and it's available through the rest api.

In python:

- I started by looking at the temp sddraft Pro used to publish my service. I realised that a few values regarding cache were different so i changed to following: 

  1. schemaLockingEnabled -> true
  2. isCached -> true
  3. useLocalCacheDir -> true
  4. clientCachingAllowed -> true
  5. cacheDir -> {path/to/created/cache/folder}

- I also added the xml node 'useExistingCache' -> true that wasn't there before.

When I run my code, during the analysis I recieve the error message: WARNING 086225: A pre-existing cache was found on the server for the service being published (Orphan cache found). But the precalculated cache is not linked.

I've also tried to add the tile schema to the sddraft in the key 'TileCacheSchemaFile' -> {path/to/schema} without any changes to the error message.

q1: How do I go about doing this task without the error? I can't seem to find the right documentation about this on the esri platform

It seems the analyzer finds the cache folder but doen't link the scheme like it does in Pro. Am I missing a key in the sddraft to allow it to change the scheme if it finds one?

q2: How is the error not findable with a google search?

I'm aware that sddrafts comming from ArcGIS Pro are quite different from sddrafts made with arcpy.

Thanks for reading, anything helps at this point hahaha

-N
0 Kudos
0 Replies