AnsweredAssumed Answered

Update MMPK on Portal through Python API - Max MMPK Size?

Question asked by Higgy1988 on Feb 13, 2020

Hi,

 

I have used the following script to update a MMPK on AGOL:

 

from arcgis.gis import GIS

gis = GIS(your_portal_url, your_username, your_password)

 

mmpk = gis.content.search("title:The Title of Your MMPK In Your Portal")
mmpk[0].update(data=r"c:\Your_Directory_Path\Your_Map_Package.mmpk")

 

This works perefectly with a sample of data (approx 30mb) but i get a gateway timeout error when i try to run it with the full MMPK which is approx 1gb.

 

Error as follows:

 

Traceback (most recent call last):
  File "C:/TEMP/Python/Share Water and Sewer Mobile Map Package.py", line 5, in <module>
    water_mmpk[0].update(data=r"J:\Workbank\WB00006 Tasks\WB00006-18307 O'BoyleS Create Mobile Map Package\WB00006-18307\WaterNetwork.mmpk")
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 7874, in update
    large_thumbnail)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\portalpy.py", line 2219, in update_item
    resp = self.con.post(path, postdata, files)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py", line 1100, in post
    resp = opener.open(req)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 504: Gateway Time-out

 

Any help or advice appreciated.

 

Thanks

Ciaran

Outcomes