Improve error when destroying a project and the +deleted path already exists on disk
Zendesk ticket: https://gitlab.zendesk.com/agent/tickets/104440 (internal link)
A customer was attempting to delete a project but wasn't able to because the +deleted
file already existed on disk. He wasn't sure how this could have happened although he said he tried to remove the project a few times in the UI and failed.
In the UI, he tried to remove the project and got an error stating:
Failed to remove project repository. Please try again or contact administrator.
The error came from here and actually failed while renaming the repo because the file name created with the DELETED_FLAG
already existed on disk. Removing this file from disk successfully allowed a deletion in the rails console with ProjectDestroyWorker.new.perform(project.id, user.id, {})
.
We should improve the error message in the log so the admin knows where to look for the underlying problem. We I saw the above on a call, it wasn't initially clear what the problem was.