Question

DOCTL: LB remove-droplets: Error: DELETE ... need to provide either a tag or a list of droplets

Hi,

I am trying to remove one droplet with id 222 from Loadbalancer with lb_id=88-33-ff via doctl command as follow:

doctl compute load-balancer remove-droplets 88-33-ff --droplet-ids 222 

but i got the following error:

Error: DELETE https://api.digitalocean.com/v2/load_balancers/xxx-xx-xx-xx-xxx/droplets: 422 (request "xxx-xx-xxx-xxx-xxxx") need to provide either a tag or a list of droplets

is my command correct or i am missing something? can anyone please help me and give a tip?

Note: here lb-id and droplet-id are fake, but the real one exist. Reference: https://docs.digitalocean.com/reference/doctl/reference/compute/load-balancer/remove-droplets/

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I’ve run into the same problem using both the doctl CLI and the DigitalOcean API.

I’ve noticed that when droplets were individually added to the load balancer, they can be removed using doctl / API. However, when the droplets were added by tag, the remove-droplets operation fails.

The update a load balancer section of the API documentation states “it may contain one of the droplets_ids or tag attributes as they are mutually exclusive.” My guess is that either the CLI / API are not able to remove tag-based droplets, or that the required parameters are not published.

Hi there,

I tried this with a fresh new Loadbalancer and a Droplet and it worked well with the following command:

doctl compute load-balancer remove-droplets lb-id-here-6123-4qs3-aab0 --droplet-ids 123456789

What is the version of your doctl command-line tool? I could suggest trying to upgrade it to the latest one and then test the command again.

Let me know how it goes. Regards, Bobby