Actions
Bug #12946
closedWhen the creation of new virtual instance (compute) fails at the "Set up compute instance" stage, we get "TypeError: can't convert nil into String" instead of the underlying error
Description
2015-12-28 04:18:54 [app] [W] Action failed | TypeError: can't convert nil into String | /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/openstack/models/compute/server.rb:87:in `pack' | /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/openstack/models/compute/server.rb:87:in `user_data=' | /opt/rh/ruby193/root/usr/share/gems/gems/fog-core-1.32.0/lib/fog/core/attributes.rb:118:in `block in merge_attributes' | /opt/rh/ruby193/root/usr/share/gems/gems/fog-core-1.32.0/lib/fog/core/attributes.rb:113:in `each_pair' | /opt/rh/ruby193/root/usr/share/gems/gems/fog-core-1.32.0/lib/fog/core/attributes.rb:113:in `merge_attributes' | /opt/rh/ruby193/root/usr/share/gems/gems/fog-core-1.32.0/lib/fog/core/model.rb:20:in `initialize' | /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/openstack/models/compute/server.rb:67:in `initialize' | /opt/rh/ruby193/root/usr/share/gems/gems/fog-core-1.32.0/lib/fog/core/collection.rb:89:in `new' | /opt/rh/ruby193/root/usr/share/gems/gems/fog-core-1.32.0/lib/fog/core/collection.rb:89:in `new' | /usr/share/foreman/app/models/compute_resource.rb:123:in `new_vm' | /usr/share/foreman/app/models/concerns/orchestration/compute.rb:24:in `compute_object' | /usr/share/foreman/app/views/hosts/_compute.html.erb:1:in `_app_views_hosts__compute_html_erb__2860077454053786827_70025660232560'
The real error is:
2015-12-28 04:18:50 [app] [W] Failed to create a compute Openstack_Jenkins (OpenStack) instance stgweb811.example.com: Expected([200, 202]) <=> Actual(403 Forbidden)
| excon.error.response
| :body => "{\"forbidden\": {\"message\": \"Quota exceeded for instances: Requested 1, but already used 14 of 14 instances\", \"code\": 403}}"
| :headers => {
| "Content-Length" => "121"
| "Content-Type" => "application/json; charset=UTF-8"
| "Date" => "Mon, 28 Dec 2015 10:18:49 GMT"
| "Retry-After" => "0"
| "X-Compute-Request-Id" => "req-7f2a68d3-fd96-47ee-bd4b-8e7808ca1de5"
| }
| :local_address => "10.84.10.74"
| :local_port => 40189
| :reason_phrase => "Forbidden"
| :remote_ip => "10.84.8.217"
| :status => 403
| :status_line => "HTTP/1.1 403 Forbidden\r\n"
|
|
| RuntimeError: Expected([200, 202]) <=> Actual(403 Forbidden)
| excon.error.response
| :body => "{\"forbidden\": {\"message\": \"Quota exceeded for instances: Requested 1, but already used 14 of 14 instances\", \"code\": 403}}"
| :headers => {
| "Content-Length" => "121"
| "Content-Type" => "application/json; charset=UTF-8"
| "Date" => "Mon, 28 Dec 2015 10:18:49 GMT"
| "Retry-After" => "0"
| "X-Compute-Request-Id" => "req-7f2a68d3-fd96-47ee-bd4b-8e7808ca1de5"
| }
| :local_address => "10.84.10.74"
| :local_port => 40189
| :reason_phrase => "Forbidden"
| :remote_ip => "10.84.8.217"
| :status => 403
| :status_line => "HTTP/1.1 403 Forbidden\r\n"
|
| /usr/share/foreman/app/models/compute_resources/foreman/model/openstack.rb:93:in `rescue in create_vm'
| /usr/share/foreman/app/models/compute_resources/foreman/model/openstack.rb:77:in `create_vm'
| /usr/share/foreman/app/models/concerns/orchestration/compute.rb:76:in `setCompute'
| /usr/share/foreman/app/models/concerns/orchestration.rb:152:in `execute'
| /usr/share/foreman/app/models/concerns/orchestration.rb:97:in `block in process'
| /usr/share/foreman/app/models/concerns/orchestration.rb:89:in `each'
| /usr/share/foreman/app/models/concerns/orchestration.rb:89:in `process'
| /usr/share/foreman/app/models/concerns/orchestration.rb:19:in `on_save'
Updated by The Foreman Bot almost 10 years ago
- Status changed from New to Ready For Testing
- Assignee set to Imri Zvik
- Pull request https://github.com/theforeman/foreman/pull/3006 added
Updated by Imri Zvik almost 10 years ago
The root cause of the first exception (TypeError: can't convert nil into String), is that the delUserData method (the rollback method) did not remove the :user_data attribute, but set it to nil instead. We should remove it instead.
Updated by Imri Zvik almost 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 3ce9810bc26e49a11ba6bc978deaf5520311efc8.
Updated by Dominic Cleal almost 10 years ago
- Translation missing: en.field_release set to 104
Actions