I'm using the modules and notebooks from https://www.esri.com/arcgis-blog/products/arcgis-hub/announcements/introducing-arcgis-hub-python-api... and I'm running into difficulties. The issue I'm experiencing appears to be listed as a bug on the Github site, howerver I'm not fully sure.
I have 2 AGOL organisations and I wan to clone the initiative/site from one or to another using the sample @ https://github.com/Esri/hub-py/tree/master/examples/For%20arcgishub%20library cloning and initiative from another org. I follow the sample and all works until the last piece - the actual cloning ! it errors with
TypeError: 'NoneType' object is not subscriptable
It actually clones the objectto my secondary agol instance but no content shows up and I dont have access to the site - it says I don't have permission - and I'm the owner...
The traceback is
TypeError Traceback (most recent call last) In : Line 1: site = hub_basic.initiatives.clone(i1, origin_hub=myHub) File c:\python_clone_env\arcgispro-py3_additional\src\arcgishub\arcgishub\hub.py, in clone: Line 558: new_site = self._hub.sites.clone(site, pages=True, title=title) File c:\python_clone_env\arcgispro-py3_additional\src\arcgishub\arcgishub\sites.py, in clone: Line 652: _data = self._create_and_register_site(new_item, subdomain, site.definition, content_group_id, collab_group_id) File c:\python_clone_env\arcgispro-py3_additional\src\arcgishub\arcgishub\sites.py, in _create_and_register_site: Line 340: client_key = _app_dict['client_id'] TypeError: 'NoneType' object is not subscriptable
Has anybody got any ideas ? have I made incorrect assumptions with cloning from instance to instance on AGOL? Have I missed a step ? Everything is Public on the origin instance . Do I have any other options for cloning content between organisations?
Any guidance with this would be hugely appreciated, if I cant get it to work its back to agol assistant and a lot of cut and paste!...
I just cloned an initiative in another organization and I noticed that it works fine.
This indeed was a problem in an older version of the API and has been fixed. Are you using an older version of the API or have you updated it in the last two months? If this issue persists after updating the version of the API as it is on the repository as of today, https://github.com/Esri/hub-py do you mind sending me the initiative id of the initiative you are trying to clone? I will inspect it further.
Sure... This is weird, if I check it on ArcGIS Pro the version installed is the 1.8.3 (and I don't have the chance to upload).
But if I check it on the command window it seems to be 1.8.4 version.
So I don't really know which one is working......
Thanks a lot!!
In general, the error means that you attempted to index an object that doesn't have that functionality. You are trying to subscript an object which you think is a list or dict, but actually is None. This means that you tried to do:
NoneType is the type of the None object which represents a lack of value, for example, list1 = list.sort(list1) : - here, you are setting it to None. None always has no data, so NoneType object is not subscriptable. In order to correct this error this should be list1.sort().
Thanks a lot for your answer. However I not able to fix the error, I don't know how to avoid this NoneType.
Could you please explain yourself a little bit more?? :)
Thanks a lot in advance!