<?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 Re: Timeout error in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771035#M705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How long before you get the error, i.e., how much time expires?&amp;nbsp; On the surface, it looks like AGOL is terminating the connection:&amp;nbsp; "existing connection was forcibly closed by the remote host."&amp;nbsp; You can also get a similar error when an organizational firewall terminates the connection.&amp;nbsp; All the client knows is that the connection was terminated remotely, not exactly who or what terminated it.&amp;nbsp; I would check with your IT department and ask about firewall timeouts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 14 Oct 2018 13:37:04 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2018-10-14T13:37:04Z</dc:date>
    <item>
      <title>Timeout error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771031#M701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a large feature layer that is constantly updated and resides on AGOL. The feature layer contains over 77,000 parcels. My program worked fine when testing it on a smaller data set but now I am getting a time out error. I was able to modify the api, if a 504 error occurred&amp;nbsp; and while I can successfully delete all the records, but I cannot add new records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code and the error message are posted below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;req = requests.get(siteurl,&lt;SPAN style="color: #660099;"&gt;timeout&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;1000 &lt;/SPAN&gt;)

&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;req.status_code == &lt;SPAN style="color: #0000ff;"&gt;200&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp; logging.info(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"success"&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; target = GIS(siteurl, uname, pword)
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;#Search for file by title owner and type
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp; 
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;newquery = (&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"title: " &lt;/SPAN&gt;+ &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'"' &lt;/SPAN&gt;+ filetitle + &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'"' &lt;/SPAN&gt;+ &lt;SPAN style="color: #008000; font-weight: bold;"&gt;" AND owner: " &lt;/SPAN&gt;+ &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'"' &lt;/SPAN&gt;+ fileowner + &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'"'&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;parcelsearch = target.content.search(&lt;SPAN style="color: #660099;"&gt;query &lt;/SPAN&gt;= (newquery), &lt;SPAN style="color: #660099;"&gt;item_type &lt;/SPAN&gt;= &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'Feature Layer Collection'&lt;/SPAN&gt;, &lt;SPAN style="color: #660099;"&gt;max_items &lt;/SPAN&gt;= &lt;SPAN style="color: #0000ff;"&gt;1000&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;layer &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;parcelsearch:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(layer.title)

&amp;nbsp;&amp;nbsp; feature_layer = parcelsearch[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; epoch_crt = datetime.datetime.fromtimestamp(feature_layer.created/&lt;SPAN style="color: #0000ff;"&gt;1000.0&lt;/SPAN&gt;).strftime(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'%d/%m/%Y'&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp; crt_epoch = datetime.datetime.strptime(epoch_crt, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'%d/%m/%Y'&lt;/SPAN&gt;).strftime(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'%m/%d/%Y'&lt;/SPAN&gt;).replace(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'X0'&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'X'&lt;/SPAN&gt;).replace(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'X'&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;''&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp; epoch_mod = datetime.datetime.fromtimestamp(feature_layer.modified/&lt;SPAN style="color: #0000ff;"&gt;1000.0&lt;/SPAN&gt;).strftime(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'%d/%m/%Y'&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp; mod_epoch = datetime.datetime.strptime(epoch_mod, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'%d/%m/%Y'&lt;/SPAN&gt;).strftime(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'%m/%d/%Y'&lt;/SPAN&gt;).replace(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'X0'&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'X'&lt;/SPAN&gt;).replace(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'X'&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;''&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; logging.info(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Url of feature layer %s Feature Layer id %s Item created on %s Item modified on %s" &lt;/SPAN&gt;% (feature_layer.url, feature_layer.id, crt_epoch, mod_epoch))
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; flc = FeatureLayerCollection(feature_layer.url, target)
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; flc_ly1=flc.layers[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; f1_list = feature_layer.layers
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;#delete the file and add records
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp; 
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;parcel = f1_list[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]

&amp;nbsp;&amp;nbsp; logging.info(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Total number of records before delete %s " &lt;/SPAN&gt;%parcel.query(&lt;SPAN style="color: #660099;"&gt;return_count_only&lt;/SPAN&gt;=&lt;SPAN style="color: #000080;"&gt;True&lt;/SPAN&gt;)) &lt;SPAN style="color: #808080;"&gt;#get the total number of features
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(parcel.delete_features(&lt;SPAN style="color: #660099;"&gt;where&lt;/SPAN&gt;=&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"objectid &amp;gt; 0"&lt;/SPAN&gt;)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logging.info(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Total number of records after delete %s " &lt;/SPAN&gt;%parcel.query(&lt;SPAN style="color: #660099;"&gt;return_count_only&lt;/SPAN&gt;=&lt;SPAN style="color: #000080;"&gt;True&lt;/SPAN&gt;)) &lt;SPAN style="color: #808080;"&gt;#get the total number of features
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;newfile = FeatureLayerCollection.fromitem(feature_layer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uploadfile = (&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"r" &lt;/SPAN&gt;+ &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"'" &lt;/SPAN&gt;+ filenm + &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"'"&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(uploadfile)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;#spatialDataFrame = fs.SpatialDataFrame(data=df, geometry=listGeometries)
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sdf1 = SpatialDataFrame.from_featureclass(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'C:\name of geodatabase file)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fs = sdf1.to_featureset()


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parcel.edit_features(&lt;SPAN style="color: #660099;"&gt;adds&lt;/SPAN&gt;=fs)


error message:

&lt;/PRE&gt;&lt;P&gt;File "Updateparcels_agol.py", line 119, in &amp;lt;module&amp;gt;&lt;BR /&gt; parcel.edit_features(adds=fs)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\layer.py", line 1121, in edit_features&lt;BR /&gt; return self._con.post(path=edit_url, postdata=params, token=self._token)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py", line 1104, in post&lt;BR /&gt; resp = opener.open(url, data=encoded_postdata.encode())&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 526, in open&lt;BR /&gt; response = self._open(req, data)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 544, in _open&lt;BR /&gt; '_open', req)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 504, in _call_chain&lt;BR /&gt; result = func(*args)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 1361, in https_open&lt;BR /&gt; context=self._context, check_hostname=self._check_hostname)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 1320, in do_open&lt;BR /&gt; raise URLError(err)&lt;BR /&gt;urllib.error.URLError: &amp;lt;urlopen error [WinError 10054] An existing connection was forcibly closed by the remote host&amp;gt;#&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:36:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771031#M701</guid>
      <dc:creator>annegrimes2</dc:creator>
      <dc:date>2021-12-12T08:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771032#M702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Were you able to get past this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 20:32:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771032#M702</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2018-10-12T20:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771033#M703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No. I tried everything. I looped thru the data, added it in chunks of 1000. I still get the timeout. So no resolution to date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anne&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2018 21:05:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771033#M703</guid>
      <dc:creator>annegrimes2</dc:creator>
      <dc:date>2018-10-12T21:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771034#M704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm, I wonder if it would be a good time to get in touch with tech support over this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Oct 2018 06:06:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771034#M704</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2018-10-14T06:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771035#M705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How long before you get the error, i.e., how much time expires?&amp;nbsp; On the surface, it looks like AGOL is terminating the connection:&amp;nbsp; "existing connection was forcibly closed by the remote host."&amp;nbsp; You can also get a similar error when an organizational firewall terminates the connection.&amp;nbsp; All the client knows is that the connection was terminated remotely, not exactly who or what terminated it.&amp;nbsp; I would check with your IT department and ask about firewall timeouts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Oct 2018 13:37:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/timeout-error/m-p/771035#M705</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-10-14T13:37:04Z</dc:date>
    </item>
  </channel>
</rss>

