Project

General

Profile

Bug #3567

Editing an oVirt compute resource can throw errors loading quotes while loading page

Added by Dominic Cleal over 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When editing an oVirt compute resource that's currently failing (e.g. bad admin password), the form won't load as it tries to get a list of quotas to display.

ActionView::Template::Error (401 Unauthorized):
    9:                  :class => "btn + #{datacenters.empty? ? "" : "btn-success"}",
    10:                  :'data-url' => test_connection_compute_resources_path) + image_tag('/assets/spinner.gif', :id => 'test_connection_indicator', :class => 'hide').html_safe }) %>
    11: <% quotas = (f.object.uuid.nil? && controller.action_name != 'test_connection') ? [] : f.object.quotas rescue []%>
    12: <%= select_f f, :ovirt_quota, quotas, :id, :name, {}, :label => _("Quota ID") %>
  app/helpers/layout_helper.rb:102:in `block in select_f'
  app/helpers/layout_helper.rb:130:in `block (2 levels) in field'
  app/helpers/layout_helper.rb:129:in `block in field'
  app/helpers/layout_helper.rb:124:in `field'
  app/helpers/layout_helper.rb:101:in `select_f'
  app/views/compute_resources/form/_ovirt.html.erb:12:in `_e7f9f939742f59e4e7d0512e1f936645'
  app/views/compute_resources/_form.html.erb:25:in `block in _d266af4e81ccfd6ac887a7d9ddb43142'
  app/helpers/layout_helper.rb:207:in `form_for'
  app/views/compute_resources/_form.html.erb:2:in `_d266af4e81ccfd6ac887a7d9ddb43142'
  app/views/compute_resources/edit.html.erb:3:in `_85d3215036b294085739cb8c859e0d6d'
  app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

It appears the f.object.quotas rescue [] doesn't work because the quotas are lazy-loaded, so it only fails when rendering the select box.


Related issues

Has duplicate Foreman - Bug #4354: Can't modify compute resource if the host has been changedDuplicate2014-02-15

Associated revisions

Revision 2e66b04a (diff)
Added by Amos Benari over 5 years ago

fixes #3567 Editing an oVirt compute resource can throw errors loading quotas while loading page

Revision 3d2ff14c (diff)
Added by Amos Benari over 5 years ago

fixes #3567 Editing an oVirt compute resource can throw errors loading quotas while loading page

(cherry picked from commit 2e66b04a2c92bc40fea1bfdc7f0414435754f49b)

History

#1 Updated by Leah Fisher over 5 years ago

I get a similar stack trace when trying to edit the url as my oVirt computer resource hostname changed.

OVIRT::OvirtException
No route to host - connect(2)
app/helpers/layout_helper.rb:102:in `block in select_f'
app/helpers/layout_helper.rb:130:in `block (2 levels) in field'
app/helpers/layout_helper.rb:129:in `block in field'
app/helpers/layout_helper.rb:124:in `field'
app/helpers/layout_helper.rb:101:in `select_f'
app/views/compute_resources/form/_ovirt.html.erb:12:in `_app_views_compute_resources_form__ovirt_html_erb__4002904617136824044_69772300'
app/views/compute_resources/_form.html.erb:25:in `block in app_views_compute_resources_form_html_erb__4329327287041218040_70310364708480'
app/helpers/layout_helper.rb:205:in `form_for'
app/views/compute_resources/_form.html.erb:2:in `_app_views_compute_resources__form_html_erb__4329327287041218040_70310364708480'
app/views/compute_resources/edit.html.erb:3:in `_app_views_compute_resources_edit_html_erb__1218224518361486307_70310364700580'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

#2 Updated by Dominic Cleal over 5 years ago

  • Has duplicate Bug #4354: Can't modify compute resource if the host has been changed added

#3 Updated by Amos Benari over 5 years ago

  • Status changed from New to Ready For Testing
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal over 5 years ago

  • Assignee set to Amos Benari
  • Target version set to 1.9.1

#5 Updated by Dominic Cleal over 5 years ago

  • Legacy Backlogs Release (now unused) set to 5

#6 Updated by Amos Benari over 5 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF