Issue
If an owner of a collection has been deleted from MongoDB, the Collections page in the Admin views shows a blank page and will not load.
image.pngEnvironment Details
Cause
The user who owns a collection was deleted or removed from MongoDB. It is also possible that the user's name was NULL when the profile was created or has become invalid.
Searching for the problematic collection
- Press F12 to open Web development tools (In Chrome, it's called just Developer tools).
- In the Web Developer tools, go to the Network tab.
- Open Gallery Admin, then go to Collections. The Gallery UI will become blank.
- Back in the Web Developer tools, you will see a list of API calls. Look for the GET request that opens the collections (/gallery/api/curator/collections/?v=1xxxxxxxxxxxxx)
- Click Response (or Preview for Chrome)
- Expand each of the Objects and look for the Owner field where the value is NULL.
- Copy the value of the ID. See the screenshot below for further details.
image.png
Resolution
IMPORTANT: Before proceeding, please ensure that you have backup your MongoDB as there is a risk of corrupting the MongoDB when performing direct modifications. See
MongoDB Backup for more information.
- Locate the collection of the user who was deleted. By running the db.getCollection('collections').find({"CollectionId" : "CollectionID"}). The collection ID is the ID you found via Web Developer tools. For this example, we have db.getCollection('collections').find({"CollectionId" : "0d12fbfe6cd444a48e308fd7b905e0b3"})
image.png - Look for an active / valid user from the Users view on the Gallery Admin page and copy the ID as shown in the below screenshot
image.png - Go back to Robo3T, Right-click > Edit, and then replace the OwnerID with the ID above. See the below screenshot for reference.
image.png - Try refreshing the Collections page in the Gallery Admin view and it should now be able to load. Repeat the same procedure for other problematic collections with NULL owner.
Additional Resources