API calls should retry on HTTP error code 503?
When using vagrant-linode, I encountered this error on several machines:
An unexpected error occurred when executing the action on the
'osd28' machine. Please report this as a bug:
API threw HTTP error code 503
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:77:in `error_check'
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:72:in `call'
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:62:in `block in make_call'
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:63:in `make_call'
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:44:in `method_missing'
/home/pdonnell/.vagrant.d/gems/gems/vagrant-linode-0.2.7/lib/vagrant-linode/actions/create.rb:50:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/home/pdonnell/.vagrant.d/gems/gems/vagrant-linode-0.2.7/lib/vagrant-linode/actions/connect_linode.rb:31:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/home/pdonnell/.vagrant.d/gems/gems/vagrant-linode-0.2.7/lib/vagrant-linode/actions/message_not_created.rb:11:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/synced_folders.rb:87:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/provision.rb:80:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:225:in `action_raw'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:200:in `block in action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:561:in `lock'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:186:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:186:in `action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
Perhaps related to throttling? I guess the API call function should be retrying after a timed wait?
Yes, it should handle errors like this, possibly retrying if the conditions are amenable. The API returns 200s with ErrorCodes for most validation type errors and 429 for rate limited responses. 5xxs are unplanned. Were your requests made during the 9/14 or 9/8 temporary API outages? https://status.linode.com/
If you continue to get these and you can provide more detail (the time of the request, at least) I can snoop around the other side of the curtain (Linode employee) and determine exactly what should have happened during the client call. If the details are sensitive you can submit them in a Linode ticket.
This happened last night. It may be relevant that I was creating a lot of linodes at once, 30+.