Hi there,
I want to overwrite Feature Layers from ArcGIS Pro to ArcGIS Online. When it comes to arcpy.server.StageService I get the following error: ERROR 001272: Analyzer errors were encountered (code:00363). It tells me to change the names SHAPE__AREA or SHAPE__LENGTH in my attribute table because their reserved for use by map and feature services, but I have a feature service.
Here is the link to the documentary:
https://pro.arcgis.com/en/pro-app/latest/help/sharing/analyzer-error-messages/00362-datasets-expose-reserved-field-names.htm
Here is my code.
# Create FeatureSharingDraft and set overwrite property
server_type = "HOSTING_SERVER"
#iterate through the layers and upload
i = 0
for layername in pro:
print(matching[layername])
sddraft = geoMap.getWebLayerSharingDraft(server_type, "FEATURE", matching[layername])
sddraft.overwriteExistingService = True
sddraft.exportToSDDraft(finalsddraft[i])
arcpy.server.StageService(finalsddraft[i], finalsd[i])
arcpy.server.UploadServiceDefinition(finalsd[i], server_type)
i += 1
Traceback (most recent call last):
File "<string>", line 54, in <module>
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\server.py", line 1088, in StageService
raise e
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\server.py", line 1085, in StageService
retval = convertArcObjectToPythonObject(gp.StageService_server(*gp_fixargs((in_service_definition_draft, out_service_definition, staging_version), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 001272: Analyzer errors were encountered ([{"code":"00362","message":"The dataset 'L0polygons' exposes the reserved field name: 'Shape__Area'. Rename or remove this field.","object":"polygons"},{"code":"00362","message":"The dataset 'L0polygons' exposes the reserved field name: 'Shape__Length'. Rename or remove this field.","object":"polygons"},{"code":"00362","message":"The dataset 'L0polygons' exposes the reserved field name: 'Shape__Area'. Rename or remove this field.","object":"polygons"},{"code":"00362","message":"The dataset 'L0polygons' exposes the reserved field name: 'Shape__Length'. Rename or remove this field.","object":"polygons"}]).
Failed to execute (StageService).
I have been unable to find details about ERROR 001272. Any suggestions for a soltion?