Bug 1664296

Summary: error message have wrong links: Failure parsing Kickstart default PXELinux: undefined method `full_path' for nil:NilClass. [Edit]
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: ProvisioningAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: ehelms, inecas, sshtein
Target Milestone: 6.5.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.20.1.11-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:39:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Hutař 2019-01-08 11:00:27 UTC
Description of problem:
Error message have wrong links: Failure parsing Kickstart default PXELinux: undefined method `full_path' for nil:NilClass. [Edit]


Version-Release number of selected component (if applicable):
satellite-6.5.0-5.beta.el7sat.noarch (snap #10)


How reproducible:
always


Steps to Reproduce:
1. I'm in a state that when I click Hosts -> All hosts -> <host> -> Build,
   I'm getting error message in the dialogue:

> Warning: This will delete this host and all of its data! This host's stored facts and reports will be deleted too.
> The following errors may prevent a successful build:
> 
> Templates
> 
> Failure parsing Kickstart default PXELinux: undefined method `full_path' for nil:NilClass.
> Failure parsing Kickstart default PXEGrub: undefined method `full_path' for nil:NilClass.
> Failure parsing Kickstart default PXEGrub2: undefined method `full_path' for nil:NilClass.
> Failure parsing Kickstart default iPXE: undefined method `full_path' for nil:NilClass.
> Failure parsing Kickstart default: undefined method `full_path' for nil:NilClass.
> Failure parsing Kickstart default finish: undefined method `full_path' for nil:NilClass.
> Failure parsing Kickstart default user data: undefined method `full_path' for nil:NilClass.

2. These failures above have "Edit" buttons which leads to links like:

    https://sat650snap4.example.com/templates/provisioning_templates/Kickstart%20default%20PXELinux/edit


Actual results:
That link gives "Oops, we're sorry but something went wrong Couldn't find Template with 'id'=Kickstart default PXELinux"

Correct link should have ID in it:

    https://sat650snap4.example.com/templates/provisioning_templates/14-Kickstart%20default%20PXELinux/edit


Expected results:
Link is correct or there is no such link

Comment 2 Shimon Shtein 2019-01-09 10:39:35 UTC
The link is generated wrongly by app/views/hosts/_build_review_status.html.erb that sends error[:edit_id] to link generator.
We should pass the whole template object instead.
From looking at #templates_status (method that tries to render template and generates the error) in app/services/host_build_status.rb, I don't see a valid id in the object.
The code should either generate the ID or pass the whole template model in the error.

Comment 5 Ivan Necas 2019-02-11 17:21:10 UTC
Created redmine issue https://projects.theforeman.org/issues/26029 from this bug

Comment 6 Bryan Kearney 2019-02-11 19:05:47 UTC
Upstream bug assigned to inecas

Comment 7 Bryan Kearney 2019-02-11 19:05:48 UTC
Upstream bug assigned to inecas

Comment 8 Bryan Kearney 2019-02-26 21:04:37 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26029 has been resolved.

Comment 10 Roman Plevka 2019-03-12 13:03:22 UTC
VERIFIED
on sat6.5.0-19

when i click "Build" on the host page I get the dialog showing the warning about loosing the facts and reports and then there is a background call to 

https://sat-6-5-qa-rhel7.localhost.example.com/hosts/fmn-tdwqddjwcd.localhost.example.com/review_before_build, which returns 200 with the html snippet containing the "reboot now" checkbox.

there are no other requests nor errors.

Comment 12 errata-xmlrpc 2019-05-14 12:39:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222