Bug 2135418

Summary: rubygem-foreman_hooks scriptlet issues an error message
Product: Red Hat Satellite Reporter: Radek Mynar <rmynar>
Component: PackagingAssignee: Eric Helms <ehelms>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.12.0CC: ehelms, lpramuk, zhunting
Target Milestone: 6.13.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_hooks-0.3.17-3.1.el8sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 13:22:16 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 Radek Mynar 2022-10-17 15:21:34 UTC
Description of problem:
Following error is shown during disconnected installation of Satellite 6.12
 Error in POSTTRANS scriptlet in rpm package rubygem-foreman_hooks

Version-Release number of selected component (if applicable):
Satellite 6.12, rubygem-foreman_hooks-0.3.17-3.el8sat.noarch

How reproducible:
always

Steps to Reproduce:
1. prepare a clean RHEL machine for Satellite
2. prepare and mount RHEL and Satellite media for disconnected installation
3. go to /media/sat6/
4. launch installer (./install_packages), use "--nogpgsigs" if using nigtly build with unsigned packages

Actual results:
Installation is finished, but error message is shown. Following entry is in /var/log/dnf.rpm.log

 2022-10-17T09:23:24-0400 INFO /var/tmp/rpm-tmp.iYG6nz: line 1: fg: no job control
 warning: %posttrans(rubygem-foreman_hooks-0.3.17-3.el8sat.noarch) scriptlet failed, exit status 1
 
 2022-10-17T09:23:24-0400 ERROR Error in POSTTRANS scriptlet in rpm package rubygem-foreman_hooks

Expected results:
No errors

Additional info:
The error does not appear during connected installation.

Comment 2 Lukas Pramuk 2023-01-25 12:38:56 UTC
# rpm -q --scripts -p rubygem-foreman_hooks-0.3.17-3.el8sat.noarch.rpm
posttrans scriptlet (using /bin/sh):
%{foreman_plugin_log}


# %{foreman_plugin_log}
bash: fg: %{foreman_plugin_log}: no such job


>>> unresolved spec variable

Comment 3 Eric Helms 2023-01-25 12:52:41 UTC
That output does not prove anything as the RPM has dependencies, and without the dependencies you are negating the ability for that macro to exist.

When attempting to test this, I was not able to reproduce it in a live environment. Have you seen the issue pop up again in your environment?

Comment 4 Evgeni Golov 2023-01-26 13:49:37 UTC
%{foreman_plugin_log} is a macro we introduced in Foreman 3.3 (which needs to be present at *build* time, not *install* time).

The build (https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=2055434) however was done with foreman-3.1 (see https://download.eng.bos.redhat.com/brewroot/vol/rhel-8/packages/rubygem-foreman_hooks/0.3.17/3.el8sat/data/logs/noarch/installed_pkgs.log) and thus the macro was never replaced.

Rebuild and be happy.

Comment 5 Lukas Pramuk 2023-02-08 14:05:21 UTC
VERIFIED.

@Satellite 6.13.0 Snap 9
rubygem-foreman_hooks-0.3.17-3.1.el8sat.noarch

by this simple manual step:

# rpm -q --scripts rubygem-foreman_hooks
posttrans scriptlet (using /bin/sh):

echo foreman_hooks >> /usr/share/foreman/tmp/restart_required_changed_plugins || : 
chown foreman:foreman /usr/share/foreman/tmp/restart_required_changed_plugins || :

>>> there are now no errors produced by scriptlet

Comment 9 errata-xmlrpc 2023-05-03 13:22:16 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 (Important: Satellite 6.13 Release), 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-2023:2097