Giter Club home page Giter Club logo

Comments (3)

andrewsomething avatar andrewsomething commented on June 12, 2024

Hi @vlad2095,

I'm not able to reproduce this. When deleting a floating IP attached to a Droplet, it is completely deleted, not just unassigned. For example, with doctl which uses godo:

$ doctl compute floating-ip create --droplet-id 270960839
IP                 Region    Droplet ID    Droplet Name
143.244.220.237    nyc3      270960839     ubuntu-s-1vcpu-1gb-nyc3-02
$ doctl compute floating-ip get 143.244.220.237
IP                 Region    Droplet ID    Droplet Name
143.244.220.237    nyc3      270960839     ubuntu-s-1vcpu-1gb-nyc3-02
$ doctl compute floating-ip delete 143.244.220.237 --trace
Warning: Are you sure you want to delete this floating IP? (y/N) ? y
doctl: 2021/10/26 12:11:41 -> "DELETE /v2/floating_ips/143.244.220.237 HTTP/1.1\r\nHost: api.digitalocean.com\r\nUser-Agent: doctl/1.65.0-release (linux amd64) godo/1.69.0\r\nAccept: application/json\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n"
$ doctl compute floating-ip get 143.244.220.237
Error: GET https://api.digitalocean.com/v2/floating_ips/143.244.220.237: 404 (request "43546723-48f0-428b-98b9-39b027fe1825") The resource you requested could not be found.

Can you share any more details about your code? Can you still reproduce the issue?

from godo.

bithavoc avatar bithavoc commented on June 12, 2024

I can confirm there is an issue here, or at least some undocumented new behavior.

The API states:\

image

This used to work as described, but not anymore. There seems to be a new intermediate state between the first FloatingIPs.Delete and the second FloatingIPs.Delete, here's a screenshot from the dashboard:

digitalocean floating ips deleted dashboard

So the status of the floating IP is like this now:

  • Released on first call to FloatingIPs.Delete
  • Removed on second call FloatingIPs.Delete

The crazy thing is, after the first Delete it becomes Released and FloatingIPs.Get fails with 404 which explains what @andrewsomething is seeing with doctl.

could it be related to floating ip's in custom non-default projects?

My walk-around is to ignore the 404 errors when releasing the IP the second time, here's how I'm doing it:

if gerr, ok := err.(*godo.ErrorResponse); ok {
		res := gerr.Response
		if res != nil {
			switch res.StatusCode {
			case 404:

				return providers.NewNotFoundError("resource not found in DigitalOcean")
			}
		}
		return gerr
}

Edit: this is not a library issue, it must be at API level. I tried with v1.19.0 which is what I was originally using and the latest v1.73.0 presents the same behavior.

from godo.

ChiefMateStarbuck avatar ChiefMateStarbuck commented on June 12, 2024

Hello @bithavoc,

I passed this on to the internal floating ips team and they could not detect any issue.
I also attempted to reproduce this bug this morning and was able to delete floating ips on the first attempt. I will close this issue as not reproducible. Please re-open if you have any future concerns or comments.

thank you

from godo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.