Bug 1919434 - foreman-maintain package lock check indicates false failure
Summary: foreman-maintain package lock check indicates false failure
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: 6.8.4
Assignee: Eric Helms
QA Contact: Devendra Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-22 20:35 UTC by James Jeffers
Modified: 2024-03-25 17:58 UTC (History)
7 users (show)

Fixed In Version: foreman-installer-2.1.2.11-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1881150
Environment:
Last Closed: 2021-02-24 12:47:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 31135 0 Normal Closed foreman-maintain package lock check indicates false failure 2021-02-16 17:47:07 UTC
Red Hat Product Errata RHBA-2021:0654 0 None None None 2021-02-24 12:47:24 UTC

Description James Jeffers 2021-01-22 20:35:51 UTC
+++ This bug was initially created as a clone of Bug #1881150 +++

From https://bugzilla.redhat.com/show_bug.cgi?id=1880637#c1

We have logic that attempts to detect if foreman-maintain is installed and package locking is enabled but the output isn't being interpreted correctly.



"""
/usr/share/foreman-installer/hooks/post/30-upgrade.rb
~~~
if !app_value(:noop) && [0, 2].include?(@kafo.exit_code) && foreman_server?
  execute('foreman-rake upgrade:run')
end
~~~
which appears to kick off if the kafo-puppet run had a "bad" exit code. 

Looking back at that puppet run, the only error I see is
~~~
[ INFO 2020-09-18T18:21:00 verbose] Executing hooks in group pre_commit
[ERROR 2020-09-18T18:21:05 verbose] foreman-maintain packages is-locked --assumeyes failed! Check the output for error!
[ INFO 2020-09-18T18:21:05 verbose] All hooks in group pre_commit finished
~~~
There are a number of warnings though.

Running that command gives:
~~~
root@tstr000047:/var/log/foreman-installer $ foreman-maintain packages is-locked --assumeyes; echo $?
Packages are not locked
1
~~~

I ran it again with debug and captured this:
~~~
[ INFO 2020-09-18T19:03:39 main] Executing hooks in group pre_commit
[DEBUG 2020-09-18T19:03:39 main] Hook /usr/share/foreman-installer/katello/hooks/pre_commit/05-puppet_certs_exist.rb returned nil
[DEBUG 2020-09-18T19:03:39 main] Executing: foreman-maintain packages -h
[DEBUG 2020-09-18T19:03:41 main] Usage:
[DEBUG 2020-09-18T19:03:41 main]     foreman-maintain packages [OPTIONS] SUBCOMMAND [ARG] ...
[DEBUG 2020-09-18T19:03:41 main]
[DEBUG 2020-09-18T19:03:41 main] Parameters:
[DEBUG 2020-09-18T19:03:41 main]     SUBCOMMAND                    subcommand
[DEBUG 2020-09-18T19:03:41 main]     [ARG] ...                     subcommand arguments
[DEBUG 2020-09-18T19:03:41 main]
[DEBUG 2020-09-18T19:03:41 main] Subcommands:
[DEBUG 2020-09-18T19:03:41 main]     lock                          Prevent packages from automatic update
[DEBUG 2020-09-18T19:03:41 main]     unlock                        Enable packages for automatic update
[DEBUG 2020-09-18T19:03:41 main]     status                        Check if packages are protected against update
[DEBUG 2020-09-18T19:03:41 main]     install                       Install packages in an unlocked session
[DEBUG 2020-09-18T19:03:41 main]     update                        Update packages in an unlocked session
[DEBUG 2020-09-18T19:03:41 main]     is-locked                     Check if update of packages is allowed
[DEBUG 2020-09-18T19:03:41 main]
[DEBUG 2020-09-18T19:03:41 main] Options:
[DEBUG 2020-09-18T19:03:41 main]     -h, --help                    print help
[DEBUG 2020-09-18T19:03:41 main] foreman-maintain packages -h finished successfully!
[DEBUG 2020-09-18T19:03:41 main] Executing: foreman-maintain packages is-locked --assumeyes
[DEBUG 2020-09-18T19:03:43 main] Packages are not locked
[ERROR 2020-09-18T19:03:43 main] foreman-maintain packages is-locked --assumeyes failed! Check the output for error!
[DEBUG 2020-09-18T19:03:43 main] Hook /usr/share/foreman-installer/katello/hooks/pre_commit/09-version_locking.rb returned nil
~~~

It looks like that's ultimately coming from
/usr/share/foreman-installer/hooks/boot/03-foreman-maintain-extensions.rb
~~~
  def package_lock_feature?
    foreman_maintain('packages -h')
  end
~~~
"""

--- Additional comment from  on 2020-10-23T00:23:24Z 

Created redmine issue https://projects.theforeman.org/issues/31135 from this bug

--- Additional comment from  on 2020-10-26T16:59:50Z 

Upstream bug assigned to ehelms

--- Additional comment from  on 2020-10-26T16:59:52Z 

Upstream bug assigned to ehelms

--- Additional comment from  on 2020-11-02T21:03:00Z 

*** Bug 1889669 has been marked as a duplicate of this bug. ***

--- Additional comment from  on 2020-11-13T20:03:46Z 

Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31135 has been resolved.

--- Additional comment from  on 2021-01-08T21:55:24Z 

The fix for this bugzilla is in an early Satellite 6.9 SNAP; therefore, aligning to release and updating state.

Comment 8 Devendra Singh 2021-02-05 16:14:45 UTC
Verified on 6.8.4 Snap 1

Comment 13 errata-xmlrpc 2021-02-24 12:47:14 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 (Satellite 6.8.4 Async Bug Fix Update), 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/RHBA-2021:0654


Note You need to log in before you can comment on or make changes to this bug.