Have you ever had a space that cannot be accessed? Even by an administrator. You know it exists, but no one has permission to see it. For instance, no one can delete it, yet you cannot create a space with the same key as Confluence says it already exists. Some symptoms of this issue are:
Not permitted to delete space with key: ...
A space already exists with key ...
We see this problem on Cloud randomly (but often) in our automated testing. We have not seen this on Server.
This post describes how to fix this problem.
Easy enough via the UI: Administration → Space Permissions → look for space and find a Recover Permissions link.
-a renderRequest --request /admin/permissions/grantspacepermissions.action --requestParameters key=XXX --file ""