ERROR

Save edits failed. ERROR: code:504, Your request has timed out., Proxy server got bad address from remote server (verify the server is running)

Last Published: July 18, 2023

Error Message

When running a process that involves updating or editing an ArcGIS Server service, such as running a calculation on a field in an attribute table using the Calculate Field tool or running a Python script, the process fails and returns the following error message:

Error:
Save edits failed. ERROR: code:504, Your request has timed out., Proxy server got bad address from remote server (verify the server is running).

The following is an example script requesting to update a hosted feature layer definition with ArcGIS API for Python that may result in the same error:

gis = arcgis.GIS(display="<display_name>")
item = gis.get_item_by_id("<item_id>")
collection = FeatureLayerCollection.fromitem(item)
overwrite_result = collection.manager.overwrite(zipfile_path)
update_dict = {"capabilities": "Query", "syncEnabled": True}
collection.manager.update_definition(update_dict)

When calling the update_definition() function in the script above, the script fails and returns the following error message with the same error code 504:

Error:
Exception: Your request has timed out.
(Error Code: 504)

Cause

The process is unable to complete within the timeout duration set on the hosting server. Depending on the capability of the machine or the service, the process may take a longer time than the timeout duration. When the time taken is longer than the timeout duration set on ArcGIS Server Manager, the process is stopped abruptly as the connection between the service and ArcGIS Pro is stopped.

Solution or Workaround

To solve the issue, increase the service timeout duration on ArcGIS Server Manager. Refer to Problem: Service time out in ArcGIS Notebooks before script completion when run on ArcGIS Server services for more information. This process increases the timeout duration permanently until it is changed again.

Alternatively, when running a Python script, the timeout duration can be set to increase within the script. When running the script to connect to the portal, the expiration parameter can be set as shown in the following example:

gis = GIS("https://machine.domain.com/portal", "username", "password", expiration=9999)

Article ID:000030751

Software:
  • ArcGIS Server
  • ArcGIS Pro 3 1
  • ArcGIS Pro 2 9x
  • ArcGIS Enterprise 10 9 x
  • ArcGIS Enterprise 11 0
  • ArcGIS Enterprise 11 1
  • ArcGIS Pro 3 0
  • ArcGIS Enterprise 10 8 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options