scaleway / docker-machine-driver-scaleway

:whale: Scaleway driver for Docker Machine
MIT License
249 stars 34 forks source link

Unable to remove a stopped machine #99

Open mjrider opened 5 years ago

mjrider commented 5 years ago

I get the following error when trying to delete a stopped machine. Not sure if it is a machine driver or a api issue. But not being able to delete an stopped instance sound like a bug to me

$docker-machine create --driver=scaleway --scaleway-commercial-type=DEV1-S --scaleway-image=debian_stretch --scaleway-region=par1 --scaleway-name="testing-docker-machine" testing-docker-machine
....
$ docker-machine stop testing-docker-machine
Stopping "testing-docker-machine"...
Machine "testing-docker-machine" was stopped.
$ docker-machine rm testing-docker-machine
About to remove testing-docker-machine
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): y
Error removing host "testing-docker-machine": StatusCode: 400, Type: invalid_request_error, APIMessage: server should be running

after starting i'm able to delete the machine

$ docker-machine start testing-docker-machine
Starting "testing-docker-machine"...
Machine "testing-docker-machine" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
$ docker-machine rm testing-docker-machine
About to remove testing-docker-machine
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): y
Successfully removed testing-docker-machine
mjrider commented 5 years ago

i found this issue when i was trying to use scaleway as gitlab-runner with the docker+machine autoscaling feature. This prevents the gitlab-runner from functioning correctly because it could not delete instances

pierredittgen commented 4 years ago

I've got similar issues using a 'docker+machine' gitlab runner. Gitlab runner can't remove archived machines. Errors found in /var/log/syslog:

ERROR: Error removing host "runner-7iqb95xu-dbnomics-autoscale-runner-1569232922-eb14a01e": StatusCode: 400, Type: invalid_request_error, APIMessage: server should be running  name=runner-7iqb95xu-dbnomics-autoscale-runner-1569232922-eb14a01e operation=remove
anthonybriand commented 4 years ago

Same problem here cannot remove archived machines

xorti commented 4 years ago

Same problem here. It really needs to delete the instance instead of archiving it.

Apr 24 15:50:02 orion gitlab-runner[31566]: About to remove runner-yjcsa7c4-gitlab-runner-autoscale-1587738586-0b2e29ff  name=runner-yjcsa7c4-gitlab-runner-autoscale-1587738586-0b2e29ff operation=remove
Apr 24 15:50:02 orion gitlab-runner[31566]: WARNING: This action will delete both local reference and remote instance.  name=runner-yjcsa7c4-gitlab-runner-autoscale-1587738586-0b2e29ff operation=remove
Screenshot 2020-04-24 at 4 08 54 PM

P.S.: I also have an issue where the MachineName is not reflected on Scaleway instances name.