<?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 Error 504 when query 30000 records for feature table in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-504-when-query-30000-records-for-feature/m-p/1669307#M11796</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Our client code already run for 6 months and suddenly we got hit with 504 Gateway Timeout.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;svc = gis.content.get(svcid)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;layerA = svc.layers[layerA_id]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;layerB = svc.tables[layerB_id]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;recordA = layerA.query(where=query, as_df=True)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;recordB = layerB.query(as_df=True)&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;recordA line works but recordB doesn't work.&lt;BR /&gt;&lt;BR /&gt;Based on the code recordB will query everything which is up to 30k of records. We do have services timeout until 5 minutes.&lt;BR /&gt;&lt;BR /&gt;It seems to be working for past 6 months but only today it doesn't work. I did try to query only for 10 records, but it hits the timeout issue.&lt;BR /&gt;&lt;BR /&gt;The only workaround I have for now is to call layer thru the REST call.&lt;BR /&gt;&lt;BR /&gt;Is it potentially python API issues or environment issues? I'm afraid it might eventually come to recordA once recordA data grow and need to apply the same workaround&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 01 Dec 2025 10:01:34 GMT</pubDate>
    <dc:creator>Muhammad_AzhaziqBin_Mohd_Azlan</dc:creator>
    <dc:date>2025-12-01T10:01:34Z</dc:date>
    <item>
      <title>Error 504 when query 30000 records for feature table</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-504-when-query-30000-records-for-feature/m-p/1669307#M11796</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Our client code already run for 6 months and suddenly we got hit with 504 Gateway Timeout.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;svc = gis.content.get(svcid)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;layerA = svc.layers[layerA_id]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;layerB = svc.tables[layerB_id]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;recordA = layerA.query(where=query, as_df=True)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;recordB = layerB.query(as_df=True)&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;recordA line works but recordB doesn't work.&lt;BR /&gt;&lt;BR /&gt;Based on the code recordB will query everything which is up to 30k of records. We do have services timeout until 5 minutes.&lt;BR /&gt;&lt;BR /&gt;It seems to be working for past 6 months but only today it doesn't work. I did try to query only for 10 records, but it hits the timeout issue.&lt;BR /&gt;&lt;BR /&gt;The only workaround I have for now is to call layer thru the REST call.&lt;BR /&gt;&lt;BR /&gt;Is it potentially python API issues or environment issues? I'm afraid it might eventually come to recordA once recordA data grow and need to apply the same workaround&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Dec 2025 10:01:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-504-when-query-30000-records-for-feature/m-p/1669307#M11796</guid>
      <dc:creator>Muhammad_AzhaziqBin_Mohd_Azlan</dc:creator>
      <dc:date>2025-12-01T10:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error 504 when query 30000 records for feature table</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-504-when-query-30000-records-for-feature/m-p/1669316#M11797</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/89517"&gt;@Muhammad_AzhaziqBin_Mohd_Azlan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This sounds like it could be a service issue.&amp;nbsp; If you publish the same data as a new service, are you able to reproduce the issue?&lt;/P&gt;&lt;P&gt;What type of service are you querying?&amp;nbsp; For example, is it a 11.5 referenced ArcGIS Server service?&lt;/P&gt;&lt;P&gt;What version of the API are you using?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 12:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-504-when-query-30000-records-for-feature/m-p/1669316#M11797</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2025-12-01T12:13:20Z</dc:date>
    </item>
  </channel>
</rss>

