Bug 1661471

Summary: Missing routes when checking facts containing '/'
Product: Red Hat Satellite Reporter: Avijit Roy <avroy>
Component: FactAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Radovan Drazny <rdrazny>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: aruzicka, bkearney, dsynk, mhulan, pcreech, rdrazny, satellite6-bugs, saydas, sgraessl, tim.morris
Target Milestone: 6.7.0   
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:23:48 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 Avijit Roy 2018-12-21 10:19:13 UTC
Description of problem:

Getting below error while selecting facts  mountpoints &  partitions

"Oops, we're sorry but something went wrong No route matches {:action=>"index", :controller=>"fact_values", :host_id=>"vm249-255.gsslab.pnq2.redhat.com", :parent_fact=>"mountpoints::/"}, possible unmatched constraints: [:parent_fact]
"

"Oops, we're sorry but something went wrong No route matches {:action=>"index", :controller=>"fact_values", :host_id=>"vm249-255.gsslab.pnq2.redhat.com", :parent_fact=>"partitions::/dev/mapper/rhel_vm249--255-root"}, possible unmatched constraints: [:parent_fact]
"

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

6.4

How reproducible:
100%

Steps to Reproduce:
1. Monitor > Facts > Select mountpoints or partitions. 
2.
3.

Actual results:
Getting Error:

"Oops, we're sorry but something went wrong No route matches {:action=>"index", :controller=>"fact_values", :host_id=>"vm249-255.gsslab.pnq2.redhat.com", :parent_fact=>"mountpoints::/"}, possible unmatched constraints: [:parent_fact]
"

"Oops, we're sorry but something went wrong No route matches {:action=>"index", :controller=>"fact_values", :host_id=>"vm249-255.gsslab.pnq2.redhat.com", :parent_fact=>"partitions::/dev/mapper/rhel_vm249--255-root"}, possible unmatched constraints: [:parent_fact]
"


Expected results:

Facts should be shown.

Additional info:

Logs captured in Production.log

==> /var/log/foreman/production.log <==
2018-12-21T05:09:29 [I|app|fe1b5]   Rendered collection of fact_values/_fact.html.erb [7 times] (8.2ms)
2018-12-21T05:09:29 [I|app|fe1b5]   Rendered fact_values/index.html.erb within layouts/application (253.0ms)
2018-12-21T05:09:29 [W|app|fe1b5] Action failed
ActionView::Template::Error: No route matches {:action=>"index", :controller=>"fact_values", :host_id=>"vm249-255.gsslab.pnq2.redhat.com", :parent_fact=>"mountpoints::/"}, possible unmatched constraints: [:parent_fact]
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/journey/formatter.rb:55:in `generate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:748:in `generate'

Comment 3 Tim 2019-03-13 19:28:20 UTC
Still present in 6.4.2, exactly as described by Avijit.

Comment 6 Bryan Kearney 2019-08-02 10:06:40 UTC
Upstream bug assigned to mhulan

Comment 7 Bryan Kearney 2019-08-02 10:06:42 UTC
Upstream bug assigned to mhulan

Comment 9 Bryan Kearney 2019-08-29 12:06:46 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/16818 has been resolved.

Comment 12 Marek Hulan 2019-10-11 07:51:44 UTC
The patch is tiny and easy to backport, if the need be.

Comment 17 Radovan Drazny 2020-02-06 12:10:59 UTC
The fix works, it is now possible to click on mountpoint/partitions/"facts with / in it",  but there is an edge case, where a fact is processed incorrectly. Normally, clicking on a mountpoint fact shows detailed facts about the mountpoint (size, size_bytes, capacity, used, etc.). This works for all sub-mounts - /home, /boot, /dev etc. But clicking on the root partition (/) doesn't show these detailed facts, and goes back to the main fact page for the given host instead. Satellite  interprets a lone "/" incorrectly, even when it is a part of a "mountpoint" fact.

Comment 23 errata-xmlrpc 2020-04-14 13:23:48 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-2020:1454