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

Compute tasks endpoint does not exist anymore #7

Open
angristan opened this issue Oct 4, 2020 · 0 comments
Open

Compute tasks endpoint does not exist anymore #7

angristan opened this issue Oct 4, 2020 · 0 comments

Comments

@angristan
Copy link

angristan commented Oct 4, 2020

A vagrant halt is broken using vagrant-scaleway. The machine is indeed powered off but vagrant returns an error. The issues comes from fog-scaleway, so I open this issue here.

➜  vagrant-scaleway git:(master) ✗ vagrant up
Bringing machine 'default' up with 'scaleway' provider...
==> default: Creating a server with the following settings...
==> default:  -- Commercial Type: DEV1-XL
==> default:  -- Image: 471029d5-e616-488f-8d13-8a02a3297e43
==> default:  -- Name: devenv
==> default: Starting the server...
==> default: Waiting for server to become "ready"...
==> default: Waiting for SSH to become available...
==> default: Machine is booted and ready for use!
➜  vagrant-scaleway git:(master) ✗ vagrant halt
==> default: Stopping the server...
Traceback (most recent call last):
	50: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/bin/vagrant:205:in `<main>'
	49: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/environment.rb:290:in `cli'
	48: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/cli.rb:67:in `execute'
	47: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/plugins/commands/halt/command.rb:30:in `execute'
	46: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/plugin/v2/command.rb:232:in `with_target_vms'
	45: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/plugin/v2/command.rb:232:in `each'
	44: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/plugin/v2/command.rb:242:in `block in with_target_vms'
	43: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/plugins/commands/halt/command.rb:31:in `block in execute'
	42: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:201:in `action'
	41: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:201:in `call'
	40: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/environment.rb:613:in `lock'
	39: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:215:in `block in action'
	38: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:243:in `action_raw'
	37: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
	36: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
	35: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
	34: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
	33: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	32: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
	31: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	30: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/call.rb:53:in `call'
	29: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
	28: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
	27: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
	26: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
	25: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	24: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
	23: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	22: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/vagrant-scaleway-0.4.1/lib/vagrant-scaleway/action/connect_scaleway.rb:30:in `call'
	21: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	20: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/vagrant-scaleway-0.4.1/lib/vagrant-scaleway/action/stop_server.rb:17:in `call'
	19: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/server.rb:115:in `poweroff'
	18: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/server.rb:134:in `execute_action'
	17: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/server.rb:134:in `tap'
	16: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/server.rb:136:in `block in execute_action'
	15: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/model.rb:74:in `wait_for'
	14: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/wait_for.rb:6:in `wait_for'
	13: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/wait_for.rb:6:in `loop'
	12: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/wait_for.rb:7:in `block in wait_for'
	11: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/model.rb:75:in `block in wait_for'
	10: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/model.rb:48:in `reload'
	 9: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/tasks.rb:13:in `get'
	 8: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/requests/compute/get_task.rb:6:in `get_task'
	 7: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/request_helper.rb:12:in `get'
	 6: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/compute.rb:128:in `request'
	 5: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/client.rb:17:in `request'
	 4: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/connection.rb:81:in `request'
	 3: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/excon-0.76.0/lib/excon/connection.rb:281:in `request'
	 2: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/excon-0.76.0/lib/excon/connection.rb:450:in `response'
	 1: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/excon-0.76.0/lib/excon/middlewares/response_parser.rb:12:in `response_call'
/Users/stanislas/.vagrant.d/gems/2.6.6/gems/excon-0.76.0/lib/excon/middlewares/expects.rb:13:in `response_call': Expected([200]) <=> Actual(403 Forbidden) (Excon::Error::Forbidden)
excon.error.response
  :body          => "{\"type\": \"authorization_required\", \"message\": \"Authorization required\"}"
  :cookies       => [
  ]
  :headers       => {
    "content-length"            => "71"
    "content-security-policy"   => "default-src 'none'; frame-ancestors 'none'"
    "content-type"              => "application/json"
    "date"                      => "Sun, 04 Oct 2020 11:21:52 GMT"
    "server"                    => "Scaleway API-Gateway"
    "strict-transport-security" => "max-age=63072000"
    "warning"                   => "299 - \"Deprecated API please use https://api.scaleway.com/instance/v1/zones/fr-par-1/\""
    "x-content-type-options"    => "nosniff"
    "x-frame-options"           => "DENY"
    "x-request-id"              => "3dde2e63-125a-497c-ac96-7dc623b99ec2"
  }
  :host          => "cp-PAR1.scaleway.com"
  :local_address => "10.66.66.2"
  :local_port    => 64477
  :path          => "/tasks/99fe428d-b512-4cbc-a751-0ff60b2ab8c1"
  :port          => 443
  :reason_phrase => "Forbidden"
  :remote_ip     => "51.159.69.134"
  :status        => 403
  :status_line   => "HTTP/1.1 403 Forbidden\r\n"
	50: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/bin/vagrant:205:in `<main>'
	49: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/environment.rb:290:in `cli'
	48: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/cli.rb:67:in `execute'
	47: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/plugins/commands/halt/command.rb:30:in `execute'
	46: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/plugin/v2/command.rb:232:in `with_target_vms'
	45: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/plugin/v2/command.rb:232:in `each'
	44: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/plugin/v2/command.rb:242:in `block in with_target_vms'
	43: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/plugins/commands/halt/command.rb:31:in `block in execute'
	42: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:201:in `action'
	41: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:201:in `call'
	40: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/environment.rb:613:in `lock'
	39: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:215:in `block in action'
	38: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:243:in `action_raw'
	37: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
	36: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
	35: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
	34: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
	33: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	32: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
	31: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	30: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/call.rb:53:in `call'
	29: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
	28: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
	27: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
	26: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
	25: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	24: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
	23: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	22: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/vagrant-scaleway-0.4.1/lib/vagrant-scaleway/action/connect_scaleway.rb:30:in `call'
	21: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
	20: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/vagrant-scaleway-0.4.1/lib/vagrant-scaleway/action/stop_server.rb:17:in `call'
	19: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/server.rb:115:in `poweroff'
	18: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/server.rb:134:in `execute_action'
	17: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/server.rb:134:in `tap'
	16: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/server.rb:136:in `block in execute_action'
	15: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/model.rb:74:in `wait_for'
	14: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/wait_for.rb:6:in `wait_for'
	13: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/wait_for.rb:6:in `loop'
	12: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/wait_for.rb:7:in `block in wait_for'
	11: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/model.rb:75:in `block in wait_for'
	10: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/model.rb:48:in `reload'
	 9: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/models/compute/tasks.rb:13:in `get'
	 8: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/requests/compute/get_task.rb:6:in `get_task'
	 7: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/request_helper.rb:12:in `get'
	 6: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/compute.rb:128:in `request'
	 5: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-scaleway-0.5.0/lib/fog/scaleway/client.rb:17:in `request'
	 4: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/fog-core-1.45.0/lib/fog/core/connection.rb:81:in `request'
	 3: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/excon-0.76.0/lib/excon/connection.rb:281:in `request'
	 2: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/excon-0.76.0/lib/excon/connection.rb:450:in `response'
	 1: from /Users/stanislas/.vagrant.d/gems/2.6.6/gems/excon-0.76.0/lib/excon/middlewares/response_parser.rb:12:in `response_call'
/Users/stanislas/.vagrant.d/gems/2.6.6/gems/excon-0.76.0/lib/excon/middlewares/expects.rb:13:in `response_call': Authorization required (Fog::Scaleway::Compute::AuthorizationRequired)

The request is :path => "/tasks/99fe428d-b512-4cbc-a751-0ff60b2ab8c1"

Made by

def get_task(task_id)
get("/tasks/#{task_id}")
end

According to https://developers.scaleway.com/en/products/instance/api/#endpoints there is not tasks endpoint.

I assume the poweroff call is made before this one, so that's why the server is indeed powered off.

@angristan angristan changed the title Compute task endpoint does not exist anymore Compute tasks endpoint does not exist anymore Oct 4, 2020
angristan added a commit to scaleway/vagrant-scaleway that referenced this issue Oct 4, 2020
Since the tasks API endpoint does not exist anymore (kaorimatz/fog-scaleway#7),
polling for the task will result in an error even if the actual task succeeded.

While tasks-related code should be removed from fog-scaleway,
setting async to true for the server.terminate and sever.poweroff metods
will bypass this polling.

Fixes kaorimatz#9.
angristan added a commit to scaleway/vagrant-scaleway that referenced this issue Oct 4, 2020
Since the tasks API endpoint does not exist anymore (kaorimatz/fog-scaleway#7),
polling for the task will result in an error even if the actual task succeeded.

While tasks-related code should be removed from fog-scaleway,
setting async to true for the server.terminate and server.poweroff methods
will bypass this polling.

Fixes kaorimatz#9.
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

No branches or pull requests

1 participant