Esri-Private-Sector-SEs / gbd-migration

Migration project to consolidate various orgs within the Commercial GBD team.
0 stars 0 forks source link

Dashboard copy failed (Feature Service failure) #22

Open JHendrickson4 opened 12 months ago

JHendrickson4 commented 12 months ago

"""CONSTANTS"""

CATALOG_ID = "9f82678130ef47aeb942bf87ab99a3eb" ORIGIN_TRANSFER_USER = "retail_transfer" ORIGIN_URL = "https://commteamretail.maps.arcgis.com/" ITEM_ID = "31d8af10a51d483faeec99e4c7dde162" # INSERT HERE

Creating destination folder for dashboard Solutions Template - Sales Performance (Dashboard) ... Transferring Sales Performance (map) to destination org, moving to Web Content transfer workflow ... Performing Web Content transfer for the following items: Sales Performance (map)

Exception Traceback (most recent call last) /opt/conda/lib/python3.9/site-packages/arcgis/_impl/common/_clone.py in clone(self) 3213 ) -> 3214 _add_to_definition(feature_service_admin, definition) 3215

/opt/conda/lib/python3.9/site-packages/arcgis/_impl/common/_clone.py in _add_to_definition(feature_layer_manager, definition) 6297 -> 6298 res = feature_layer_manager._con.post(u_url, params) 6299 feature_layer_manager.refresh()

/opt/conda/lib/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py in post(self, path, params, files, **kwargs) 1527 return resp -> 1528 return self._handle_response( 1529 resp=resp,

/opt/conda/lib/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py in _handle_response(self, resp, file_name, out_path, try_json, force_bytes, ignore_error_key) 1007 errorcode = data["error"]["code"] if "code" in data["error"] else 0 -> 1008 self._handle_json_error(data["error"], errorcode) 1009 return data

/opt/conda/lib/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py in _handle_json_error(self, error, errorcode) 1030 errormessage = errormessage + "\n(Error Code: " + str(errorcode) + ")" -> 1031 raise Exception(errormessage) 1032

Exception: Unable to add feature service definition. View services can only be added by service owner or admin. (Error Code: 400)

During handling of the above exception, another exception occurred:

_ItemCreateException Traceback (most recent call last) /tmp/ipykernel_20/3793353524.py in <cell line: 1>() ----> 1 transfer()

/tmp/ipykernel_20/2570575009.py in transfer() 255 sm_transfer(destination=destination, item=item_origin) 256 elif item_origin.type == "Dashboard": --> 257 dash_transfer(destination=destination, dash=item_origin, swizzle=True) 258 else: 259 wc_transfer(destination=destination, items=[item_origin])

/tmp/ipykernel_20/2570575009.py in dash_transfer(destination, dash, swizzle, records, logging) 95 try: 96 print(f"Transferring {ele.title} to destination org, moving to Web Content transfer workflow ... ") ---> 97 wc = wc_transfer(destination=destination, items=[ele]) 98 web_map_dest = [item.id for item in wc if item.type == "Web Map"] 99 wm_items[ele.id] = web_map_dest[0]

/tmp/ipykernel_20/2570575009.py in wc_transfer(destination, items, records, logging) 24 print(title) 25 ---> 26 destination_items = destination.content.clone_items(items) 27 28 print("Item(s) cloned successfully. Updating tags ... ")

/opt/conda/lib/python3.9/site-packages/arcgis/gis/init.py in clone_items(self, items, folder, item_extent, use_org_basemap, copy_data, copy_global_ids, search_existing_items, item_mapping, group_mapping, owner, preserve_item_id) 7902 preserve_item_id=preserve_item_id, 7903 ) -> 7904 return deep_cloner.clone() 7905 7906 def bulk_update(

/opt/conda/lib/python3.9/site-packages/arcgis/_impl/common/_clone.py in clone(self) 1216 1217 with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor: -> 1218 results = executor.submit(self._clone, executor).result() 1219 return results 1220

/opt/conda/lib/python3.9/concurrent/futures/_base.py in result(self, timeout) 444 raise CancelledError() 445 elif self._state == FINISHED: --> 446 return self.__get_result() 447 else: 448 raise TimeoutError()

/opt/conda/lib/python3.9/concurrent/futures/_base.py in __get_result(self) 389 if self._exception: 390 try: --> 391 raise self._exception 392 finally: 393 # Break a reference cycle with the exception in self._exception

/opt/conda/lib/python3.9/concurrent/futures/thread.py in run(self) 56 57 try: ---> 58 result = self.fn(*self.args, **self.kwargs) 59 except BaseException as exc: 60 self.future.set_exception(exc)

/opt/conda/lib/python3.9/site-packages/arcgis/_impl/common/_clone.py in _clone(self, excecutor) 1189 if item: 1190 item.delete() -> 1191 raise ex 1192 1193 level += 1

/opt/conda/lib/python3.9/concurrent/futures/thread.py in run(self) 56 57 try: ---> 58 result = self.fn(*self.args, **self.kwargs) 59 except BaseException as exc: 60 self.future.set_exception(exc)

/opt/conda/lib/python3.9/site-packages/arcgis/_impl/common/_clone.py in clone(self) 3872 return new_item 3873 except Exception as ex: -> 3874 raise _ItemCreateException( 3875 "Failed to create {0} {1}: {2}".format( 3876 original_item["type"], original_item["title"], str(ex)

_ItemCreateException: ('Failed to create Feature Service Asset_Sales_Data_View: Unable to add feature service definition.\nView services can only be added by service owner or admin.\n(Error Code: 400)', <Item title:"Asset_Sales_Data_View" type:Feature Layer Collection owner:cgs_transfer>)