AnsweredAssumed Answered

Updating hosted FS via Python...fails

Question asked by tpcolson Champion on Jun 16, 2015
Latest reply on Jun 17, 2015 by MSummers-esristaff

Following the instructions in Updating your hosted feature service for 10.2 | ArcGIS Blog , as well as some of the user replies, I cannot get update.py to update an AGOL FS. Works fine when publishing from ArcMap, fails when using the python script with this error:

 

Starting Feature Service publish process
found Feature Service : f4c43de7a4964371b1fbba68eaa15cfb
found Service Definition : d4333434f3c34a75b14b5d42fe811345
Created X:\GIS_Final\data\basedata\basemap\Data\Working\Python_Automated_Scripts
\UPDATE_AGOL\tempDir\GRSM_TRAIL_INVENTORY.sd
Traceback (most recent call last):
  File "update.py", line 294, in <module>
    if upload(finalSD, tags, description):
  File "update.py", line 171, in upload
    response = requests.post(url, files=filesUp);
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\requests\api.py", line 109, in
post
    return request('post', url, data=data, json=json, **kwargs)
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\requests\api.py", line 50, in r
equest
    response = session.request(method=method, url=url, **kwargs)
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\requests\sessions.py", line 451
, in request
    prep = self.prepare_request(req)
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\requests\sessions.py", line 382
, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\requests\models.py", line 296,
in prepare
    self.prepare_body(data, files, json)
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\requests\models.py", line 444,
in prepare_body
    (body, content_type) = self._encode_files(files, data)
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\requests\models.py", line 150,
in _encode_files
    fdata = fp.read()
MemoryError

 

Testing the requests library checks out ok:

 

python test_requests.
py
................................................................................
................................................................
----------------------------------------------------------------------
Ran 144 tests in 22.476s


OK

 

 

as does a check of openssl:

 

python -m pip install
 pyopenssl
Requirement already satisfied (use --upgrade to upgrade): pyopenssl in c:\python
27\arcgis10.2\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in c:\pytho
n27\arcgis10.2\lib\site-packages (from pyopenssl)
Requirement already satisfied (use --upgrade to upgrade): cryptography>=0.7 in c
:\python27\arcgis10.2\lib\site-packages (from pyopenssl)
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\pytho
n27\arcgis10.2\lib\site-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied (use --upgrade to upgrade): enum34 in c:\python27\
arcgis10.2\lib\site-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied (use --upgrade to upgrade): pyasn1 in c:\python27\
arcgis10.2\lib\site-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied (use --upgrade to upgrade): idna in c:\python27\ar
cgis10.2\lib\site-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in c:\python
27\arcgis10.2\lib\site-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied (use --upgrade to upgrade): cffi>=0.8 in c:\python
27\arcgis10.2\lib\site-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied (use --upgrade to upgrade): pycparser in c:\python
27\arcgis10.2\lib\site-packages (from cffi>=0.8->cryptography>=0.7->pyopenssl)

 

 

Has anyone gotten http://blogs.esri.com/esri/arcgis/2014/01/24/updating-your-hosted-feature-service-for-10-2/#comment-7801  to work?

Outcomes