<?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: ArcGIS python api 1.8.3 for new workforce random network errors in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-python-api-1-8-3-for-new-workforce-random/m-p/1010604#M59312</link>
    <description>&lt;P&gt;have you updated from pre-release?&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2020 14:54:09 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2020-12-17T14:54:09Z</dc:date>
    <item>
      <title>ArcGIS python api 1.8.3 for new workforce random network errors</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-python-api-1-8-3-for-new-workforce-random/m-p/1010456#M59307</link>
      <description>&lt;P&gt;Hi, I am using the pre release 1.8.3 python api for the new workforce. I have code that were working and starting from yesterday, it keep failing randomly in different part of the code with error either 502 or 499 (token required) while trying to automate some work flow on agol (workforce)&lt;/P&gt;&lt;P&gt;I have checked agol status and it is green light all the way. Is there anyone else experiencing the same issue?&lt;/P&gt;&lt;P&gt;agol = GIS(config.agol_credential['url'],&lt;BR /&gt;username=config.agol_credential['username'],&lt;BR /&gt;password=config.agol_credential['password'])&lt;/P&gt;&lt;P&gt;wf_project_item = agol.content.get(config.wf_project_itemId)&lt;BR /&gt;wf_project = workforce.Project(wf_project_item) my code&lt;/P&gt;&lt;P&gt;stack trace:&lt;/P&gt;&lt;P&gt;wf_project = workforce.Project(wf_project_item)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\project.py", line 71, in __init__&lt;BR /&gt;self._update_cached_objects()&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\project.py", line 85, in _update_cached_objects&lt;BR /&gt;self._cached_workers = {w.id: w for w in self.workers.search()}&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\managers.py", line 734, in search&lt;BR /&gt;return query_workers(self.project, where)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\_store\workers.py", line 43, in query_workers&lt;BR /&gt;worker_features = project.workers_layer.query(where, return_all_records=True).features&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 1540, in query&lt;BR /&gt;record_count = self._query(url, params, raw=as_raw)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 2556, in _query&lt;BR /&gt;raise queryException&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 2526, in _query&lt;BR /&gt;postdata=params, token=self._token)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 720, in post&lt;BR /&gt;force_bytes=kwargs.pop('force_bytes', False))&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 514, in _handle_response&lt;BR /&gt;self._handle_json_error(data['error'], errorcode)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 536, in _handle_json_error&lt;BR /&gt;raise Exception(errormessage)&lt;BR /&gt;Exception: Token Required&lt;BR /&gt;Token Required&lt;BR /&gt;(Error Code: 499)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Re-Running code again worked and re-running the 3rd time without any code change, it error out again.&lt;/P&gt;&lt;P&gt;wf_project = workforce.Project(wf_project_item)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\project.py", line 71, in __init__&lt;BR /&gt;self._update_cached_objects()&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\project.py", line 84, in _update_cached_objects&lt;BR /&gt;self._update_cached_assignment_types()&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\project.py", line 77, in _update_cached_assignment_types&lt;BR /&gt;self._cached_assignment_types = {a.code: a for a in self.assignment_types.search()}&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\managers.py", line 252, in search&lt;BR /&gt;return get_assignment_types_v2(self.project)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\_store\assignment_types_v2.py", line 27, in get_assignment_types_v2&lt;BR /&gt;return query_assignment_types(project, '1=1')&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\_store\assignment_types_v2.py", line 36, in query_assignment_types&lt;BR /&gt;assignment_type_features = project.assignment_types_table.query(where, return_all_records=True).features&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 2966, in query&lt;BR /&gt;record_count = self._query(url, params, raw=as_raw)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 2556, in _query&lt;BR /&gt;raise queryException&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 2526, in _query&lt;BR /&gt;postdata=params, token=self._token)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py", line 11530, in _token&lt;BR /&gt;self._hydrate()&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py", line 11509, in _hydrate&lt;BR /&gt;self._refresh()&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py", line 11452, in _refresh&lt;BR /&gt;raise e&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py", line 11445, in _refresh&lt;BR /&gt;dictdata = self._con.post(self.url, params, token=self._lazy_token)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 720, in post&lt;BR /&gt;force_bytes=kwargs.pop('force_bytes', False))&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 514, in _handle_response&lt;BR /&gt;self._handle_json_error(data['error'], errorcode)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 536, in _handle_json_error&lt;BR /&gt;raise Exception(errormessage)&lt;BR /&gt;Exception: An error occurred.&lt;BR /&gt;(Error Code: 503)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last try again:&lt;/P&gt;&lt;P&gt;wf_project = workforce.Project(wf_project_item)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\project.py", line 71, in __init__&lt;BR /&gt;self._update_cached_objects()&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\project.py", line 85, in _update_cached_objects&lt;BR /&gt;self._cached_workers = {w.id: w for w in self.workers.search()}&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\managers.py", line 734, in search&lt;BR /&gt;return query_workers(self.project, where)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\workforce\_store\workers.py", line 43, in query_workers&lt;BR /&gt;worker_features = project.workers_layer.query(where, return_all_records=True).features&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 1540, in query&lt;BR /&gt;record_count = self._query(url, params, raw=as_raw)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 2556, in _query&lt;BR /&gt;raise queryException&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py", line 2526, in _query&lt;BR /&gt;postdata=params, token=self._token)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 720, in post&lt;BR /&gt;force_bytes=kwargs.pop('force_bytes', False))&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 514, in _handle_response&lt;BR /&gt;self._handle_json_error(data['error'], errorcode)&lt;BR /&gt;File "C:\Users\vtay\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 536, in _handle_json_error&lt;BR /&gt;raise Exception(errormessage)&lt;BR /&gt;Exception: An error occurred.&lt;BR /&gt;(Error Code: 503)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 01:05:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-python-api-1-8-3-for-new-workforce-random/m-p/1010456#M59307</guid>
      <dc:creator>VictorTey</dc:creator>
      <dc:date>2020-12-17T01:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS python api 1.8.3 for new workforce random network errors</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-python-api-1-8-3-for-new-workforce-random/m-p/1010604#M59312</link>
      <description>&lt;P&gt;have you updated from pre-release?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 14:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-python-api-1-8-3-for-new-workforce-random/m-p/1010604#M59312</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-12-17T14:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS python api 1.8.3 for new workforce random network errors</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-python-api-1-8-3-for-new-workforce-random/m-p/1010843#M59318</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;, I did however I am happy to report today was alot more stable and the script is running fine now.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 02:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-python-api-1-8-3-for-new-workforce-random/m-p/1010843#M59318</guid>
      <dc:creator>VictorTey</dc:creator>
      <dc:date>2020-12-18T02:47:50Z</dc:date>
    </item>
  </channel>
</rss>

