Select to view content in your preferred language

Publishing survey causes error 500

249
2
04-09-2025 03:54 AM
CarstenAndersson
Regular Contributor

I'm getting an error when I call the following:

survey_manager = SurveyManager(gis)
survey survey_manager.create(title="Accommodation_inspection")
survey.publish(excel_file, create_web_form=True, enable_sync=True, create_web_map=True, schema_changes=True)
 
The gis variable is an instance of GIS connected with user that has capability to create and publish surveys
The Excel file used can be opened with Survey123 Connect application and validated
 
I've tried several things, eg. using a predefined info dictionary and setting the arguments for the publish arguments, but with same result.
 
The error is:
{'code': 500, 'message': "Spatial reference of layer 'Accommodation_inspection' must be the same as defined by the service.", 'details': []}
 
I've debugged within the Python library and it looks like it's hardcoded using default wkid 102100. But this is deprecated, so I don't understand why this is used. See in file C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\apps\survey123\_publish_functions.py line 802
 
Any help is greatly appreciated
Tags (2)
0 Kudos
2 Replies
ZacharySutherby
Esri Regular Contributor

Hello @CarstenAndersson

Can you clone your arcgispro-py3 environment and upgrade your arcgis package to the latest 2.4.1 version. Are you able to successfully publish in 2.4.1? 

Thank you,
Zach
0 Kudos
CarstenAndersson
Regular Contributor

Hi @ZacharySutherby.

Thanks for the reply. I will try it out today and see if it fixes the problem.

Thank you.

Carsten

0 Kudos