Actions
Bug #17339
closedCan't edit Rackspace compute resource with invalid credentials
Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Compute resources - Rackspace
Target version:
-
Description
Editing a Rackspace compute resource with invalid credentials fails to load the form:
2016-11-15T10:22:06 68910d09 [app] [I] Started GET "/compute_resources/9-rackspace/edit" for 127.0.0.1 at 2016-11-15 10:22:06 +0000 2016-11-15T10:22:06 68910d09 [app] [I] Processing by ComputeResourcesController#edit as HTML 2016-11-15T10:22:06 68910d09 [app] [I] Parameters: {"id"=>"9-rackspace"} 2016-11-15T10:22:06 68910d09 [sql] [D] ActiveRecord::SessionStore::Session Load (0.1ms) SELECT "sessions".* FROM "sessions" WHERE "sessions"."session_id" = ? ORDER BY "sessions"."id" ASC LIMIT 1 [["session_id", "68910d097bfa2184b883be61208c41ae"]] 2016-11-15T10:22:06 68910d09 [sql] [D] User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 24]] 2016-11-15T10:22:06 68910d09 [app] [D] Setting current user thread-local variable to admin 2016-11-15T10:22:06 68910d09 [sql] [D] AuthSource Load (0.1ms) SELECT "auth_sources".* FROM "auth_sources" WHERE "auth_sources"."id" = ? LIMIT 1 [["id", 1]] 2016-11-15T10:22:06 68910d09 [sql] [D] (0.1ms) SELECT COUNT(*) FROM "compute_resources" 2016-11-15T10:22:06 68910d09 [sql] [D] ComputeResource Load (0.0ms) SELECT "compute_resources".* FROM "compute_resources" WHERE "compute_resources"."id" = ? ORDER BY compute_resources.name LIMIT 1 [["id", 9]] 2016-11-15T10:22:06 68910d09 [sql] [I] Successfully decrypted field for Foreman::Model::Rackspace rackspace 2016-11-15T10:22:08 68910d09 [app] [I] Rendered compute_resources/form/_rackspace.html.erb (1611.9ms) 2016-11-15T10:22:08 68910d09 [app] [I] Rendered compute_resources/_form.html.erb (1621.2ms) 2016-11-15T10:22:08 68910d09 [app] [I] Rendered compute_resources/edit.html.erb within layouts/application (1624.6ms) 2016-11-15T10:22:08 68910d09 [app] [I] Completed 500 Internal Server Error in 1631ms (ActiveRecord: 0.3ms) 2016-11-15T10:22:08 68910d09 [app] [F] | ActionView::Template::Error ([HTTP 403 | ] Expected([200, 203]) <=> Actual(403 Forbidden) | excon.error.response | :body => "" | :cookies => [ | ] | :headers => { | "Content-Length" => "0" | "Date" => "Tue, 15 Nov 2016 10:22:08 GMT" | "Server" => "Jetty(9.2.z-SNAPSHOT)" | "Via" => "1.1 Repose (Repose/7.1.5.1)" | "x-trans-id" => "18d6fb61-5c61-4c5c-b38f-c7dcb5ee0172" | } | :host => "dfw.servers.api.rackspacecloud.com" | :local_address => "192.168.0.104" | :local_port => 42686 | :path => "/v2/10034898/flavors/detail" | :port => 443 | :reason_phrase => "Forbidden" | :remote_ip => "72.32.168.196" | :status => 403 | :status_line => "HTTP/1.1 403 Forbidden\r\n" | ): | 3: <%= password_f f, :password, :label => _("API Key"), :unset => unset_password? %> | 4: <% flavors = f.object.flavors rescue [] %> | 5: <%= selectable_f(f, :region, f.object.regions, {}, {:label => _('Region'), | 6: :help_inline_permanent => test_connection_button_f(f, !flavors.empty?) }) %> | app/views/compute_resources/form/_rackspace.html.erb:6:in `_app_views_compute_resources_form__rackspace_html_erb___4599927241175676408_70263517790060' | app/views/compute_resources/_form.html.erb:22:in `block in _app_views_compute_resources__form_html_erb___2004448844999184112_70263610797940' | app/helpers/form_helper.rb:280:in `form_for' | app/views/compute_resources/_form.html.erb:2:in `_app_views_compute_resources__form_html_erb___2004448844999184112_70263610797940' | app/views/compute_resources/edit.html.erb:3:in `_app_views_compute_resources_edit_html_erb__1721652852843436011_70263609402660' | app/controllers/concerns/application_shared.rb:14:in `set_timezone' | app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | lib/middleware/catch_json_parse_errors.rb:8:in `call' | lib/middleware/tagged_logging.rb:18:in `call' | | 2016-11-15T10:22:08 68910d09 [app] [I] Rendered /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (8.3ms) 2016-11-15T10:22:08 68910d09 [app] [I] Rendered /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.9ms) 2016-11-15T10:22:08 68910d09 [app] [I] Rendered /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.9ms) 2016-11-15T10:22:08 68910d09 [app] [I] Rendered /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (28.5ms)
It looks like flavors
is being lazy-loaded so the rescue isn't catching any authentication failures, so it instead fails when !flavors.empty?
is checked on the line below.
Updated by Dominic Cleal over 7 years ago
- Status changed from Assigned to Rejected
- Assignee deleted (
Dominic Cleal)
I can't reproduce this now, it was probably some incorrect combination of a bad identity URL and possibly an incorrect password. If anybody can, it can be re-opened.
Actions