What is a Circular Dependency
A dependency is when an item needs another item to function properly. For example, if your web map has a layer, that layer is a dependency for the web map. Circular Dependencies are when items appear to link back to themselves (either directly or through a chain). The item thinks it is a dependency of itself. Items with circular dependencies can cause issues when you try to use them.
What Causes Circular Dependencies?
An item cannot legitimately be a dependency of itself. This mis-mapping occurs when something has broken with the item. An invalid relationship may have formed, causing the item to link back to itself. It can also occur when the item's data JSON has been edited and one of the item IDs for a dependency was replaced with the item ID for the main item itself.
How to Fix a Circular Dependency
You can fix a circular dependency by editing the item’s data JSON. The easiest way to do this is by using Admin Tools for ArcGIS. The screenshots here are from the Pro version, but the functionality is included in the Free version of Admin Tools as well.
To start, find the item with the circular dependency in the table. Click on the arrow button in the third column, and a menu will appear. You will want to select “View / Edit Item Data”.
A modal will appear with a text-editor in it. The Item Info JSON will be pre-populated in the text edit. To fix the circular dependency, you must first shift the view to Item Data JSON. This can be done with the select box above the text-editor.
Once the Item Data JSON has been selected, the text-editor will update its contents. You will need to check the item ids for each of the dependencies to see which one matches the item id of the web map. In this example case, the ‘itemId’ property for the “Starbucks” layer has been edited to match the item id of the web map. To fix the circular dependency, we simply need to replace the property with the Starbucks layer’s actual item id (retrieved from our ArcGIS Organization). After editing the property, click the ‘Save’ button above the text-editor to apply the changes.
After the edits are successfully applied, the modal will display a success message. The item will have been updated in your ArcGIS Organization. Please note, you may need to clear your browser cache and refresh the web page to see the updates.
Additional Note: If you are referencing the item in another product that caches your ArcGIS Organization, such as Backup My Organization or Clean My Organization, you will need to refresh your cache for the software to reflect the updates in your ArcGIS Org.