clasp icon indicating copy to clipboard operation
clasp copied to clipboard

Can't delete versions

Open marcosscriven opened this issue 6 years ago • 17 comments

Expected Behavior

Can delete versions

Actual Behavior

Get an error saying "You cannot delete this version because it is used by a label”

screen shot 2018-06-20 at 13 29 50

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

  1. clasp version "New version"
  2. clasp open
  3. File->Manage versions
  4. Delete version

marcosscriven avatar Jun 20 '18 12:06 marcosscriven

We're limited on the API for this one. https://developers.google.com/apps-script/api/reference/rest/v1/projects.versions/create

grant avatar Jun 20 '18 16:06 grant

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?

marcosscriven avatar Jun 20 '18 16:06 marcosscriven

I've just verified the UI instructions work. Press the "X" next to a version ID.

grant avatar Jun 20 '18 16:06 grant

@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:

error

marcosscriven avatar Jun 20 '18 17:06 marcosscriven

Can you take a picture and describe the type of script (add-on, standalone, web app)?

grant avatar Jun 20 '18 17:06 grant

@grant - we crossed posts, have posted further details just prior.

marcosscriven avatar Jun 20 '18 17:06 marcosscriven

@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 avatar Jun 22 '18 03:06 shai

@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 avatar Jun 22 '18 05:06 marcosscriven

@marcosscriven let's cross fingers .. perhaps they would be able to assist in this mystery :)

shai avatar Jun 22 '18 08:06 shai

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.

shai avatar Jun 24 '18 22:06 shai

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

russellkt avatar Aug 17 '18 21:08 russellkt

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.

grant avatar Aug 17 '18 22:08 grant

Same issue. I starred @grant's link. My workaround for now...

clasp push
clasp open

and then manually publish a new version.

nitrocode avatar Aug 24 '18 16:08 nitrocode

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.

Novack avatar Jan 11 '19 17:01 Novack

Would be great to get this feature available to delete some existing versions.

darul75 avatar Apr 18 '19 11:04 darul75

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.

bostefan avatar May 25 '20 20:05 bostefan