Bug 1620126

Summary: In production webpacked_plugins_js_for $PLUGIN doesn't load the js if the plugin doesn't provide the sources
Product: Red Hat Satellite Reporter: Marek Hulan <mhulan>
Component: AnsibleAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: UnspecifiedCC: inecas, mhulan, sshtein
Target Milestone: 6.4.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.18.0.14-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:03:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Report OK none

Description Marek Hulan 2018-08-22 13:38:14 UTC
On nightly production install some components from foreman_ansible were not showing on the page. The issue was webpackage_plugins_js ignored plugins which didn't provide "webpack/index.js" in their root even though the plugin provided the precompiled assets.

Also webpacked_plugins_js fails silently if it can't find the required js

Comment 1 Marek Hulan 2018-08-22 13:38:22 UTC
Created from redmine issue https://projects.theforeman.org/issues/24371

Comment 2 Marek Hulan 2018-08-22 13:38:28 UTC
Upstream bug assigned to ekohlvan

Comment 3 Marek Hulan 2018-08-22 13:41:08 UTC
the workaround:

mkdir -p /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-2.2.5/webpack
touch /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-2.2.5/webpack/index.js
service httpd restart

that will start mounting the component on config foreman_ansible reports page again

Comment 9 Marek Hulan 2018-09-01 06:44:25 UTC
Could you please try applying the workaround from comment 3 to verify it's triggered by the same cause? It seems the patch has been applied correctly.

Comment 13 Marek Hulan 2018-09-07 07:49:32 UTC
*** Bug 1620124 has been marked as a duplicate of this bug. ***

Comment 14 Martin Korbel 2018-09-11 07:55:18 UTC
Created attachment 1482310 [details]
Report OK

Comment 15 Martin Korbel 2018-09-11 07:58:35 UTC
VERIFIED on Sat6.4#21

Reproducer:
1. We have got Sat6.4 and some client machine. On client machine we have to upload Satellite public SSH key.
   > curl -k https://<fqdn>:9090/ssh/pubkey >> ~/.ssh/authorized_keys
2. install some Ansible role to satellite
   > ansible-galaxy install -p /etc/ansible/roles/ linuxhq.setup
3. import this role to Satellite
   > hammer ansible roles import
   ---|--------------------------------|--------------------
   ID | NAME                           | IMPORTED AT        
   ---|--------------------------------|--------------------
   2  | linuxhq.setup                  | 2018/09/11 07:17:47
   3  | RedHatInsights.insights-client | 2018/09/11 07:17:47
   ---|--------------------------------|--------------------

4. assign this role to client profile. We can not use attribute --ansible-roles, because it does not work (bz1590854). 
   > hammer host update --ansible-role-ids 2 --id 1
   Host updated.
5. Open profile of host (Hosts > All hosts > client; in my case https://<fqdn>/hosts/1)
6. Click on the "Run Ansible roles" button and wait for job passes.
7. Open reports (Monitor > Config Management). 
8. choose our client and one of reports
9. we should see table with tree view structure (see attachement 1482310 )

Comment 17 Bryan Kearney 2018-10-16 19:03:22 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-2018:2927