clasp
clasp copied to clipboard
Can't delete versions
Expected Behavior
Can delete versions
Actual Behavior
Get an error saying "You cannot delete this version because it is used by a label”

Found this issue in Stackoverflow, but there's no answer.
There's also no mention on this error in the documentation.
Steps to Reproduce the Problem
- clasp version "New version"
- clasp open
- File->Manage versions
- Delete version
We're limited on the API for this one. https://developers.google.com/apps-script/api/reference/rest/v1/projects.versions/create
Thanks @grant - the issue was I couldn’t seem to delete it in the UI either. There doesn’t seem to be any explanation as to what a label is in this context, but I’m guess it’s a description?
I've just verified the UI instructions work. Press the "X" next to a version ID.
@grant for some of them it does - not all. Some must have some link to something called a 'label'. Those ones I've never been able to delete.
Looking at the response in Chrome console network tab to the XHR POST shows the same message:
//EX[2, 0, -1, 1, ["i", "You cannot delete this version because it is used by a label."], 1, 7]
This is just a standalone script. Here's a little capture:
Can you take a picture and describe the type of script (add-on, standalone, web app)?
@grant - we crossed posts, have posted further details just prior.
@grant I had the same issue, and I'm the one the OP referenced to the post in Stackoverflow with no answer to date. A reply there asked about the type of script, and for me it wasn't standalone but rather a web app. Just FYI.
I'm unclear how this could be related to clasp since this happens in the UI and is obviously something internal to GAS.
@shai - Agree it's probably a server side issue. I mentioned it here because personally I'd only ever created versions with clasp, and also because since the folks here develop the client, they may well be able to help figure out the error (which I've not seen solved anywhere).
@marcosscriven let's cross fingers .. perhaps they would be able to assist in this mystery :)
Ok .. I was playing around with issue #63 and after I used clasp deploy
twice, I saw the two new deployments in the WEB UI and lo and behold, I was not able to delete them and got this same OP message.
Furthermore, after I used clasp undeploy xxxxxx
to try and do just that, clasp
said that it undeployed my deployment, but it is still showing in the WEB UI.
Also, trying to undeploy again that same deployment yields Unable to delete read-only deployment.
Having the same issue. I was able to delete some using the ui but there are about 10 versions that I am unable to deploy. Using clasp undeploy I get Unable to delete read-only deployment. In the ui, I get You cannot delete this version because it is being used by a label
Please upvote or comment on this Apps Script bug and I'll let the team know about it so they can fix it: https://issuetracker.google.com/issues/110285291
Again, this error is not related to clasp, but Apps Script itself.
Same issue. I starred @grant's link. My workaround for now...
clasp push
clasp open
and then manually publish a new version.
Same here. For versions created from clasp deployments, I cannot delete the version, reglardless of having removed all deployments. Working on a webapp.
Hope to not bump into some limit for number of versions, as the number of deployments has.
Also commented on the GAS issuetracker.
Would be great to get this feature available to delete some existing versions.
I am surprised to find this issue still not solved. I hoped that I found a workaround : go to Publish => Deploy from manifest... and you would see the clasp-created deployment in the entries. After deleting it successfully, it still did not reflect on the inability to deleted the version connected to it.