Raw error when attempting to delete unused environment

Clicking the delete icon next to an unused environment in my team project prompts me for my 2FA code. When I enter it, the following message briefly appears in red inline in the page:
Not Authorized: {"response":{"errors":[{"message":"Not Authorized","locations":[{"line":2,"column":3}],"path":["environmentDelete"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"status":400}}}],"data":null,"status":200,"headers":{}},"request":{"query":"mutation environmentDelete($id: String!) {\n environmentDelete(id: $id)\n}","variables":{"id":"14860a72-1ba1-4e38-9c2c-78dd0c13e288"}}}
Not Authorized: {"response":{"errors":[{"message":"Not Authorized","locations":[{"line":2,"column":3}],"path":["environmentDelete"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"status":400}}}],"data":null,"status":200,"headers":{}},"request":{"query":"mutation environmentDelete($id: String!) {\n environmentDelete(id: $id)\n}","variables":{"id":"14860a72-1ba1-4e38-9c2c-78dd0c13e288"}}}
Is this an actual permissions problem or a bug? The way the message is presented makes it seem to be a bug.
8 Replies
Percy
Percy2y ago
Project ID: 14860a72-1ba1-4e38-9c2c-78dd0c13e288
Brody
Brody2y ago
@Angelo - error when attempting to delete unused environment
Percy
Percy2y ago
Flagging this thread. A team member will be with you shortly.
angelo
angelo2y ago
Quickly tagging in @gimenete
gimenete
gimenete2y ago
Looks like it's an authorization error not formatted correctly in the UI. Does it happen in any environment or just a specific one? According to the code only admin members can delete environments. I'll hide the trash can button if the current user is not an admin. Is that your case?
syntaxaire
syntaxaireOP2y ago
Yes, that is the case
gimenete
gimenete2y ago
Ok, from now on only admins will see the delete button. The main reason we are limiting it to admins is that we don't know if the environment to be deleted is the production one. We don't want to guess it by the name. One thing we could do is have some kind of protection rule on the production environment and allow non-admin users to delete any other environment that is not marked as production. What do you think?
syntaxaire
syntaxaireOP2y ago
If you want what works out of the box for the most people, just limiting deletion to admins makes sense.
Want results from more Discord servers?
Add your server