Project

General

Profile

Actions

Bug #16123

closed

After upgrade "undefined method `name' for nil:NilClass" when visiting dashboard (oscap widget)

Added by Ori Rabin over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1365299
Description of problem:

Note this is very similar to https://bugzilla.redhat.com/show_bug.cgi?id=1361793 but has a different root cause.

Here is the relevant traceback:

| NoMethodError: undefined method `name' for nil:NilClass
| /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_openscap-0.5.3.17/app/views/dashboard/_compliance_host_reports_widget.html.erb:17:in `block in _ce5dd86c4d584c323b27dd0e36789817'
| /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in `each'
| /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in `each'
| /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_openscap-0.5.3.17/app/views/dashboard/_compliance_host_reports_widget.html.erb:14:in `_ce5dd86c4d584c323b27dd0e36789817'
| /opt/rh/rh-ror41/root/usr/share/gems/gems/actionview-4.1.5/lib/action_view/template.rb:145:in `block in render'
| /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/notifications.rb:161:in `instrument'
| /opt/rh/rh-ror41/root/usr/share/gems/gems/actionview-4.1.5/lib/action_view/template.rb:339:in `instrument'
| /opt/rh/rh-ror41/root/usr/share/gems/gems/actionview-4.1.5/lib/action_view/template.rb:143:in `render'
| /opt/theforeman/tfm/root/usr/share/gems/gems/deface-1.0.2/lib/deface/action_view_extensions.rb:41:in `render'

Given the code:

&lt;td&gt;<%= link_to h(report.policy.name), policy_dashboard_policy_path(report.policy) %>&lt;/td&gt;

It seems that there is a report without a defined policy

Version-Release number of selected component (if applicable):
6.2.0

How reproducible:
Always (on this satellite)

Steps to Reproduce:
Unclear

Actual results:
dashboard throws an error

Expected results:
Dashboard does not throw an error

Additional info:


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #16044: Errors in individual dashboard widgets fail entire pageClosedTomer Brisker08/10/2016Actions
Actions #1

Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ori Rabin
  • Pull request https://github.com/theforeman/foreman_openscap/pull/186 added
Actions #2

Updated by Shlomi Zadok over 7 years ago

  • Target version set to 1.6.1
Actions #3

Updated by Ori Rabin over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Tomer Brisker over 7 years ago

  • Related to Bug #16044: Errors in individual dashboard widgets fail entire page added
Actions #5

Updated by Dominic Cleal over 7 years ago

  • Project changed from 36 to OpenSCAP
  • Triaged set to Yes
  • Pull request deleted (https://github.com/theforeman/foreman_openscap/pull/186)
Actions

Also available in: Atom PDF