Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-working Detach function #136

Merged
merged 1 commit into from
Apr 4, 2017
Merged

Remove non-working Detach function #136

merged 1 commit into from
Apr 4, 2017

Conversation

klausenbusk
Copy link
Contributor

The function returns "422 Attachment not found" all the time (tested
with doctl), and the doc* also says that droplet id should be
specified.

The function returns "422 Attachment not found" all the time (tested
with doctl), and the doc* also says that droplet id should be
specified.

* https://developers.digitalocean.com/documentation/v2/#remove-a-block-storage-volume-from-a-droplet
@klausenbusk
Copy link
Contributor Author

Sometimes it work, sometimes it does not .. Weird..

@xmudrii
Copy link
Contributor

xmudrii commented Mar 30, 2017

@klausenbusk Detach function is working well for me. Both from doctl and godo.

However, there's something weird in API docs. Detach endpoint is really missing in the docs. There are only 2 -> both requiring droplet_id property.
There is nothing in API Changelog that affects Volume functions but I remember seeing function not requiring droplet_id. Could be that I overlooked it, but I just don't see it.

Maybe someone who have more info can update us:
cc @aybabtme @mauricio

@codenrhoden
Copy link

I have seen this behavior as well, specifically as part of a driver that @protochron contributed to REX-Ray. We have an issue open for it here.

It is weird to me that the docs say that a droplet ID is required, but the godo package has a Detach function that does not require one, and one that does: https://github.com/digitalocean/godo/blob/master/storage_actions.go#L41-L56. Does the function without a Droplet ID automatically attempt to detach from all droplets (if it's ever possible to attach to more than one) ?

I haven't actually seen this happen in a few weeks, but @klausenbusk said he saw it yesterday, so I'd like to be able to help pin down what is happening.

@klausenbusk
Copy link
Contributor Author

klausenbusk commented Mar 30, 2017

@klausenbusk Detach function is working well for me. Both from doctl and godo.

What region is you using block storage in?

For me it "never" works. and now it works, this is very unreliable.

$ doctl compute volume ls
ID                                      Name             Size      Region    Droplet IDs
72c3161a-154e-11e7-8ebd-0242ac111e07    foo              1 GiB     fra1
$ doctl compute volume-action attach 72c3161a-154e-11e7-8ebd-0242ac111e07 427xxx4
ID           Status         Type             Started At                       Completed At    Resource ID    Resource Type    Region
216856877    in-progress    attach_volume    2017-03-30 19:55:57 +0000 UTC    <nil>           0              backend          fra1
$ doctl compute volume-action detach 72c3161a-154e-11e7-8ebd-0242ac111e07
detach a volume

Usage:
  doctl compute volume-action detach <volume-id> [flags]

Aliases:
  detach, d


Global Flags:
  -t, --access-token string   API V2 Access Token
  -c, --config string         config file (default is $HOME/.config/doctl/config.yaml)
  -o, --output string         output format [text|json] (default "text")
      --trace                 trace api access
  -v, --verbose               verbose output

Error: POST https://api.digitalocean.com/v2/volumes/72c3161a-154e-11e7-8ebd-0242ac111e07/actions: 422 Attachment not found

But DetachByDropletID works without any issues:

$ doctl compute volume-action detach-by-droplet-id 72c3161a-154e-11e7-8ebd-0242ac111e07 427xxx4
ID           Status         Type             Started At                       Completed At    Resource ID    Resource Type    Region
216857174    in-progress    detach_volume    2017-03-30 19:56:50 +0000 UTC    <nil>           0              backend          fra1

@klausenbusk klausenbusk reopened this Mar 30, 2017
@xmudrii
Copy link
Contributor

xmudrii commented Mar 30, 2017

I'm using Block Storage in NYC1.
Also, I built doctl from sources which should be almost same as 1.6.0. Try to update to 1.6.0 if you didn't already, I can't remember if there was any changes.

[marko@xmudrii-1 ~ ]$ doctl compute volume-action attach 6d43bc3c-1576-11e7-914d-0242ac111807 44xxxx6
ID           Status         Type             Started At                       Completed At    Resource ID    Resource Type    Region
21xxxx81    in-progress    attach_volume    2017-03-30 20:01:30 +0000 UTC    <nil>           0              backend          nyc1
[marko@xmudrii-1 ~ ]$ doctl compute volume-action detach 6d43bc3c-1576-11e7-914d-0242ac111807
ID           Status         Type             Started At                       Completed At    Resource ID    Resource Type    Region
216xxxx833    in-progress    detach_volume    2017-03-30 20:01:41 +0000 UTC    <nil>           0              backend          nyc1

@klausenbusk
Copy link
Contributor Author

I'm using Block Storage in NYC1.

I think I have found a way to reproduce this. It seems like detach stop working after the volume has been attached to more than 1 droplet.

See script: https://gist.github.com/klausenbusk/d5b6455d3253a2b0575e151719a0d12b

Could you try attaching 6d43bc3c-1576-11e7-914d-0242ac111807 to another droplet and then see if detach is still working?

@xmudrii
Copy link
Contributor

xmudrii commented Mar 30, 2017

Can confirm this is a problem:

[marko@xmudrii-1 ~ ]$ doctl compute volume ls 
ID                                      Name              Size     Region    Droplet IDs
6d43bc3c-1576-11e7-914d-0242ac111807    volume-nyc1-01    1 GiB    nyc1      
[marko@xmudrii-1 ~ ]$ doctl compute volume-action attach 6d43bc3c-1576-11e7-914d-0242ac111807 442xxx06
ID           Status         Type             Started At                       Completed At    Resource ID    Resource Type    Region
216xxx124    in-progress    attach_volume    2017-03-30 20:54:11 +0000 UTC    <nil>           0              backend          nyc1
[marko@xmudrii-1 ~ ]$ doctl compute volume-action detach 6d43bc3c-1576-11e7-914d-0242ac111807   
ID           Status         Type             Started At                       Completed At    Resource ID    Resource Type    Region
216xxx155    in-progress    detach_volume    2017-03-30 20:54:21 +0000 UTC    <nil>           0              backend          nyc1
[marko@xmudrii-1 ~ ]$ doctl compute volume-action attach 6d43bc3c-1576-11e7-914d-0242ac111807 442xxx45
ID           Status         Type             Started At                       Completed At    Resource ID    Resource Type    Region
216xxx187    in-progress    attach_volume    2017-03-30 20:54:28 +0000 UTC    <nil>           0              backend          nyc1
[marko@xmudrii-1 ~ ]$ doctl compute volume-action detach 6d43bc3c-1576-11e7-914d-0242ac111807         
detach a volume

Usage:
  doctl compute volume-action detach <volume-id> [flags]

Aliases:
  detach, d


Global Flags:
  -t, --access-token string   API V2 Access Token
  -c, --config string         config file (default is $HOME/.config/doctl/config.yaml)
  -o, --output string         output format [text|json] (default "text")
      --trace                 trace api access
  -v, --verbose               verbose output

Error: POST https://api.digitalocean.com/v2/volumes/6d43bc3c-1576-11e7-914d-0242ac111807/actions: 422 Attachment not found

However, this is API bug and not godo or doctl. You will get same results if you don't use godo. For example, use curl:

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"type": "detach"}' "https://api.digitalocean.com/v2/volumes/6d43bc3c-1576-11e7-914d-0242ac111807/actions"
{"id":"invalid","message":"Attachment not found"}

I think we need to wait official answer from DO member or maybe contact support so they report it to appropriate team.

@klausenbusk
Copy link
Contributor Author

I think we need to wait official answer from DO member or maybe contact support so they report it to appropriate team.

I have created a ticket and linked to this issue, let see what they say.

@klausenbusk
Copy link
Contributor Author

I have created a ticket and linked to this issue, let see what they say.

The supporter was able to recreate the issue and will write up a bug report for it.

@mauricio
Copy link
Contributor

Hey folks, the people responsible for this part of the system are out this week, they'll be back on monday and we should have a final decision if this call will go away or not.

@xmudrii
Copy link
Contributor

xmudrii commented Mar 31, 2017 via email

@mauricio
Copy link
Contributor

mauricio commented Apr 4, 2017

Hey folks, this is really going away, detaching volumes without droplet-id is not supported.

@mauricio mauricio closed this Apr 4, 2017
@mauricio mauricio reopened this Apr 4, 2017
@mauricio mauricio merged commit dfa8021 into digitalocean:master Apr 4, 2017
@xmudrii
Copy link
Contributor

xmudrii commented Apr 4, 2017

Thanks for update! Going to vendor it to doctl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants