Esri Example script erroring out with my server

736
2
10-30-2020 02:00 PM
JoeWeyl
Occasional Contributor

Hi -

My GIS Server site (non Portal) has a lot of services and folders. I am trying to generate an output listing of the server because I am migrating to a new server. This inventory will help me figure out what I need to move to the new environment. 

The script came from here: Example: Write properties of all services to a CSV file—ArcGIS Server | Documentation for ArcGIS Ent... 

But when it is trying to write the output to CSV, I am getting the following error message:

line 373, in main
ln = str(jsonOBJ["serviceName"]) + "," + folder + "," + str(item["type"]) + "," + jsonOBJStatus['realTimeState'] + "," + str(jsonOBJ["minInstancesPerNode"]) + "," + str(jsonOBJ["maxInstancesPerNode"]) + "," + "NA" + "," + "NA" + "," + "NA" + "," + str(jsonOBJ["properties"]["maxRecordCount"]) + "," + str(jsonOBJ["clusterName"]) + "," + "NA" + "," + "NA" + "," + str(jsonOBJ["properties"]["outputDir"]) +"\n"
KeyError: 'maxRecordCount'

It looks to me like this error is from the Service Properties for MaxRecourds, defined under the service parameters, but I am not sure. I still working on it, but if anyone has any insight that would be great.

Tags (1)
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

KeyError: 'maxRecordCount'

means there is something wrong with the dictionary key maxRecordCount ... do you have a value for it? 


... sort of retired...
0 Kudos
JoeWeyl
Occasional Contributor

I ran the code as is, I didn't set anything. 

0 Kudos