Select to view content in your preferred language

10.8.1 Portal > My Content > Add Item > Unable To Add Item IOException error

2839
1
Jump to solution
08-06-2021 07:45 AM
Labels (2)
ShanonLoughton
Esri Contributor

I cannot add an FGDB from 6MB upto 200MB+, it says error in adding. I suspect it has something to do with multi-part uploading, as seen in Portal logs (attached)?

Steps to reproduce:

10.8.1 Portal > My Content > Add Item > choose FGDB *.ZIP > select File Geodatabase, dont publish.

Expected results:

Added ok.

Actual results:

Error popup, "Error in adding item. IOException. Unable to add or update item: <title>.'

ShanonLoughton_0-1628260894956.png

More info:

- Typical requests in an upload from browser dev console is:
/additem, content-type: application/x-www-form-urlencoded
/addPart?partNum=1, content-type: multipart/form-data
/addPart?partNum=2, etc.., content-type: multipart/form-data
/commit, content-type: application/x-www-form-urlencoded

- Deployment is manually on Azure, closely following what ArcGIS CloudBuilder for Azure outputs, but could have some difference somewhere. Has a CA-signed certificate for the public listener, then self-signed certs behind for the machines.

- However, also happens on a default base stack ArcGIS CloudBuilder for Azure 10.9 on a single machine, with Portal Content on Azure blob, and with self-signed certs used.

- Connecting to ArcGIS Enterprise over a VPN, and attempting browser and python api from local machine. Connection is stable and at least 5mb/s.

- Attempted on Chrome 64bit Version 92.0.4515.131 (Official Build) (64-bit) on Windows 10 64 bit OS.

- Server machines had Cisco AMP Endpoints running. Turning off made no difference.

- FGDB sizes that can be added - 100KB, 2.5MB

- FGDB sizes that cannot be added, with same error above - 6.5MB, 90MB, 112MB

- Portal content configured for Azure blob:

 

 

 

 

 

{"type":"cloudStore","provider":"Azure","connectionString":{"accountName":"abcdefghijklmnop","accountEndpoint":"blob.core.windows.net","accountKey":"*****************************************","credentialType":"accessKey"},"objectStore":"https://abcdefghijklmnop.blob.core.windows.net/portal-content-store","isConnectionStringEncrypted":true}

 

 

 

 

 

- Portal Verbose Logs:

 

 

 

 

 

INFO	
Part 12 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:47,57	Sharing	<hostname>	portaladmin	219999	5148
SEVERE	
Failed to add or update item '253782816294401caf9df3274eb44b88'. Stream is already closed.
2021-08-07T00:15:47,531	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Added item '73099cdc51a844d6b93c5cdc9a189e5c' of type 'File Geodatabase' to the portal.
2021-08-07T00:15:47,426	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip' committed to the portal.
2021-08-07T00:15:47,374	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 13 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:46,482	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 11 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:44,667	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 9 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:35,758	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 7 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:34,818	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 6 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:34,3	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 8 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:34,251	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 10 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:33,208	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 5 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:14,523	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 1 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:12,221	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 3 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:11,81	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 2 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:10,940	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Part 4 added to multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:15:09,977	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Created multipart item '253782816294401caf9df3274eb44b88/exampleFGDB.zip'.
2021-08-07T00:14:49,433	Sharing	<hostname>	portaladmin	219999	5148
INFO	
Log settings updated. [Logs directory = 'G:\arcgisportal\logs\', Log level = VERBOSE, Max age in days = 90]
2021-08-07T00:14:39,736	Portal Admin	<hostname>		205013	5148

 

 

 

 

And another example:


<Msg time="2021-08-09T12:10:49,887" type="INFO" code="219999" source="Sharing" process="5148" thread="1" methodName="" machine="domain.com" user="portaladmin" elapsed="" requestID=""> Part 1 added to multipart item '53277fec633c41aa92ec16de984575cd/exampleFGDB.zip'.</Msg>
<Msg time="2021-08-09T12:10:50,214" type="INFO" code="219999" source="Sharing" process="5148" thread="1" methodName="" machine="domain.com" user="portaladmin" elapsed="" requestID=""> Multipart item '53277fec633c41aa92ec16de984575cd/exampleFGDB.zip' committed to the portal.</Msg>
<Msg time="2021-08-09T12:10:50,249" type="INFO" code="219999" source="Sharing" process="5148" thread="1" methodName="" machine="domain.com" user="portaladmin" elapsed="" requestID=""> Added item 'testfgdb' of type 'File Geodatabase' to the portal.</Msg>
<Msg time="2021-08-09T12:10:50,310" type="DEBUG" code="219999" source="Sharing" process="5148" thread="1" methodName="" machine="domain.com" user="portaladmin" elapsed="" requestID=""> Stream is already closed.</Msg>
<Msg time="2021-08-09T12:10:50,310" type="DEBUG" code="9999" source="Sharing" process="5148" thread="1" methodName="" machine="domain.com" user="" elapsed="" requestID="">java.io.IOException: Stream is already closed.
at com.microsoft.azure.storage.blob.BlobInputStream.close(BlobInputStream.java:237)
at com.esri.gw.util.zip.ZipUtil.analyzeZipFile(ZipUtil.java:108)
at com.esri.gw.content.GWContent.checkItemValidForPublishing(GWContent.java:9352)
at com.esri.gw.content.GWContent.a(GWContent.java:1115)
at com.esri.gw.content.GWContent.addItem(GWContent.java:1021)
at com.esri.gw.content.GWContent.a(GWContent.java:953)
at com.esri.gw.content.GWContent.processCommitMultipartItem(GWContent.java:4290)
at com.esri.gw.content.ContentRequestHandler.lambda$commitMultipartItem$2(ContentRequestHandler.java:5794)
at java.base/java.lang.Thread.run(Unknown Source)
</Msg>
<Msg time="2021-08-09T12:10:50,310" type="SEVERE" code="219999" source="Sharing" process="5148" thread="1" methodName="" machine="domain.com" user="portaladmin" elapsed="" requestID=""> Failed to add or update item '53277fec633c41aa92ec16de984575cd'. Stream is already closed.</Msg>
<Msg time="2021-08-09T12:10:50,310" type="DEBUG" code="219999" source="Sharing" process="5148" thread="1" methodName="" machine="domain.com" user="portaladmin" elapsed="" requestID=""> IOException. Unable to add or update item: 53277fec633c41aa92ec16de984575cd</Msg>
<Msg time="2021-08-09T12:10:50,310" type="DEBUG" code="9999" source="Sharing" process="5148" thread="1" methodName="" machine="domain.com" user="" elapsed="" requestID="">com.esri.gw.GWException: IOException. Unable to add or update item: 53277fec633c41aa92ec16de984575cd
at com.esri.gw.content.GWContent.a(GWContent.java:1693)
at com.esri.gw.content.GWContent.addItem(GWContent.java:1021)
at com.esri.gw.content.GWContent.a(GWContent.java:953)
at com.esri.gw.content.GWContent.processCommitMultipartItem(GWContent.java:4290)
at com.esri.gw.content.ContentRequestHandler.lambda$commitMultipartItem$2(ContentRequestHandler.java:5794)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Stream is already closed.
at com.microsoft.azure.storage.blob.BlobInputStream.close(BlobInputStream.java:237)
at com.esri.gw.util.zip.ZipUtil.analyzeZipFile(ZipUtil.java:108)
at com.esri.gw.content.GWContent.checkItemValidForPublishing(GWContent.java:9352)
at com.esri.gw.content.GWContent.a(GWContent.java:1115)
... 5 more
</Msg>

 

- Happens in python API too. Target version returned [8,2] (is that API 1.8.2?)

 

 

 

 

 

In [52]: target.version
Out[52]: [8, 2]

In [53]: newitemfgdb = target.content.add(item_properties={'type':'File Geodatabase'},data=itemdataexportedfgdb)
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-53-7885fbefd79e> in <module>
----> 1 newitemfgdb = target.content.add(item_properties={'type':'File Geodatabase'},data=itemdataexportedfgdb)

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in add(self, item_properties, data, thumbnail, metadata, owner, folder, item_id)
   4252
   4253             # Update the thumbnail and return the item
-> 4254             item = Item(gis=self._gis, itemid=itemid)
   4255             if item.type == "KML":
   4256                 item.update({'url' : f"{self._gis._portal.resturl}content/items/{item.itemid}/data"})

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in __init__(self, gis, itemid, itemdict)
   8243         except: pass
   8244
-> 8245         if self._has_layers():
   8246             self.layers = None
   8247             self.tables = None

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _has_layers(self)
   8277     #----------------------------------------------------------------------
   8278     def _has_layers(self):
-> 8279         return self.type ==  'Feature Collection' or \
   8280                self.type == 'Feature Service' or \
   8281                self.type == 'Big Data File Share' or \

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in __getattr__(self, name)
   8414     def __getattr__(self, name): # support item attributes
   8415         if not self._hydrated and not name.startswith('_'):
-> 8416             self._hydrate()
   8417         try:
   8418             return dict.__getitem__(self, name)

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in _hydrate(self)
   8370
   8371     def _hydrate(self):
-> 8372         itemdict = self._portal.get_item(self.itemid)
   8373         self._hydrated = True
   8374         super(Item, self).update(itemdict)

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_portalpy.py in get_item(self, itemid)
   1262             ================  ========================================================
   1263         """
-> 1264         return self.con.post('content/items/' + itemid, self._postdata())
   1265
   1266     def get_item_data(self, itemid, try_json=True, folder=None):

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py in post(self, path, params, files, **kwargs)
    718                                      file_name=file_name,
    719                                      try_json=try_json,
--> 720                                      force_bytes=kwargs.pop('force_bytes', False))
    721     #----------------------------------------------------------------------
    722     def put(self, url, params=None, files=None, **kwargs):

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py in _handle_response(self, resp, file_name, out_path, try_json, force_bytes)
    512                     return data
    513                 errorcode = data['error']['code'] if 'code' in data['error'] else 0
--> 514                 self._handle_json_error(data['error'], errorcode)
    515             return data
    516         else:

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py in _handle_json_error(self, error, errorcode)
    534
    535         errormessage = errormessage + "\n(Error Code: " + str(errorcode) +")"
--> 536         raise Exception(errormessage)
    537     #----------------------------------------------------------------------
    538     def post(self,

Exception: Item does not exist or is inaccessible.
(Error Code: 400)

 

 

 

 

 

ArcGIS Enterprise on AWS, Azure & Google Cloud Professional
0 Kudos
1 Solution

Accepted Solutions
ChristopherPawlyszyn
Esri Contributor

This is a known issue that has been logged with Support in relation to using Azure Blob storage for the Portal content location and uploads above 5MB. I would recommend opening a case and having it attached to the defect for tracking purposes, BUG-000139417.

 

A workaround that was identified was to publish the content from ArcGIS Pro as opposed to uploading through the browser, which may work for some of the publishing scenarios.


-- Chris Pawlyszyn

View solution in original post

1 Reply
ChristopherPawlyszyn
Esri Contributor

This is a known issue that has been logged with Support in relation to using Azure Blob storage for the Portal content location and uploads above 5MB. I would recommend opening a case and having it attached to the defect for tracking purposes, BUG-000139417.

 

A workaround that was identified was to publish the content from ArcGIS Pro as opposed to uploading through the browser, which may work for some of the publishing scenarios.


-- Chris Pawlyszyn