<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting &amp;quot;Your request has timed out&amp;quot; 504 error code exception in ArcGIS API for Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/getting-quot-your-request-has-timed-out-quot-504/m-p/1127878#M6930</link>
    <description>&lt;P&gt;Hi, I have a request to update a hosted feature layer item definition with the ArcGIS API for Python. This has worked for a long time with no issues, but just started intermittently failing. The code looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = arcgis.GIS(profile="&amp;lt;profile_name&amp;gt;")
item = gis.get_item_by_id("&amp;lt;item_id&amp;gt;")
collection = FeatureLayerCollection.fromitem(item)
overwrite_result = collection.manager.overwrite(zipfile_path)
update_dict = {"capabilities": "Query", "syncEnabled": True}
collection.manager.update_definition(update_dict)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last line intermittently fails. I get a python Exception with this message (on two lines, as shown):&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Exception: Your request has timed out.&lt;BR /&gt;(Error Code: 504)&lt;/PRE&gt;&lt;P&gt;Like I said, this has worked for a long time, and just started recently. I have 10 hosted feature layers with identical schemas, but the error only happens on some of them, so it's not just a syntax error. What's really weird is that if I skip the overwrite command (line 4, above), I cannot replicate this Exception. I wonder if the hosted feature layer is occasionally getting locked by the overwrite.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note - I did see&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error-504-on-batch-add-of-workforce/m-p/1101008" target="_self"&gt;this related issue&lt;/A&gt;&amp;nbsp;, but all my hosted feature layers are the same, so it doesn't make sense that some would fail while others succeed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Dec 2021 00:14:38 GMT</pubDate>
    <dc:creator>davedoesgis</dc:creator>
    <dc:date>2021-12-21T00:14:38Z</dc:date>
    <item>
      <title>Getting "Your request has timed out" 504 error code exception in ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/getting-quot-your-request-has-timed-out-quot-504/m-p/1127878#M6930</link>
      <description>&lt;P&gt;Hi, I have a request to update a hosted feature layer item definition with the ArcGIS API for Python. This has worked for a long time with no issues, but just started intermittently failing. The code looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = arcgis.GIS(profile="&amp;lt;profile_name&amp;gt;")
item = gis.get_item_by_id("&amp;lt;item_id&amp;gt;")
collection = FeatureLayerCollection.fromitem(item)
overwrite_result = collection.manager.overwrite(zipfile_path)
update_dict = {"capabilities": "Query", "syncEnabled": True}
collection.manager.update_definition(update_dict)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last line intermittently fails. I get a python Exception with this message (on two lines, as shown):&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Exception: Your request has timed out.&lt;BR /&gt;(Error Code: 504)&lt;/PRE&gt;&lt;P&gt;Like I said, this has worked for a long time, and just started recently. I have 10 hosted feature layers with identical schemas, but the error only happens on some of them, so it's not just a syntax error. What's really weird is that if I skip the overwrite command (line 4, above), I cannot replicate this Exception. I wonder if the hosted feature layer is occasionally getting locked by the overwrite.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note - I did see&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error-504-on-batch-add-of-workforce/m-p/1101008" target="_self"&gt;this related issue&lt;/A&gt;&amp;nbsp;, but all my hosted feature layers are the same, so it doesn't make sense that some would fail while others succeed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 00:14:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/getting-quot-your-request-has-timed-out-quot-504/m-p/1127878#M6930</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2021-12-21T00:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Your request has timed out" 504 error code exception in ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/getting-quot-your-request-has-timed-out-quot-504/m-p/1127881#M6932</link>
      <description>&lt;P&gt;Long shot, but I had intermittent issues with 504s when running some scripts against an org with a large amount of content.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if it is documented, but adding this expiration property to the GIS object fixed it for me:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = GIS(profile='yourprofilecreds', expiration=9999)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 00:31:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/getting-quot-your-request-has-timed-out-quot-504/m-p/1127881#M6932</guid>
      <dc:creator>SimonGIS</dc:creator>
      <dc:date>2021-12-21T00:31:00Z</dc:date>
    </item>
  </channel>
</rss>

