Bug 2124271 - After installing katello-agent on a RHEL 9 host, Goferd service fails to start with error AttributeError: 'Scheduler' object has no attribute 'isAlive'
Summary: After installing katello-agent on a RHEL 9 host, Goferd service fails to star...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: katello-agent
Version: 6.12.0
Hardware: All
OS: All
unspecified
high
Target Milestone: 6.12.0
Assignee: Eric Helms
QA Contact: Gaurav Talreja
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-05 13:28 UTC by Sayan Das
Modified: 2022-11-21 04:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2131770 (view as bug list)
Environment:
Last Closed: 2022-11-16 13:35:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-12789 0 None None None 2022-09-07 14:27:16 UTC
Red Hat Knowledge Base (Solution) 6974753 0 None None None 2022-09-06 08:50:14 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:35:49 UTC

Description Sayan Das 2022-09-05 13:28:37 UTC
Description of problem:

Python 3.9 has renamed the isAlive() method to is_alive(). 

RHEL 9 runs on Python 3.9 but the gofer package we ship via satellite-client-6-for-rhel-9-x86_64-rpms repo, It still contains the isAlive() method. 

# grep -r isAlive /usr/lib/python3.9/site-packages/gofer/
grep: /usr/lib/python3.9/site-packages/gofer/agent/__pycache__/plugin.cpython-39.opt-1.pyc: binary file matches
grep: /usr/lib/python3.9/site-packages/gofer/agent/__pycache__/plugin.cpython-39.pyc: binary file matches
/usr/lib/python3.9/site-packages/gofer/agent/plugin.py:        return self.scheduler.isAlive()


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

Satellite 6.11 and 6.12
RHEL 9
python3-gofer-2.12.5-7.1.el9sat.noarch


How reproducible:

Always

Steps to Reproduce:
1. Install a Sat 6.12 or 6.11

2. Sync satellite-client-6-for-rhel-9-x86_64-rpms in satellite

3. Connect a RHEL 9 client with the satellite.

4. Enable the satellite-client-6-for-rhel-9-x86_64-rpms repo on the RHEL 9 host

5. Install katello-agent on the RHEL 9 host

6. Check the status of goferd on the RHEL 9 host.
 

Actual results:

# systemctl status goferd
× goferd.service - Gofer Agent
     Loaded: loaded (/usr/lib/systemd/system/goferd.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Mon 2022-09-05 13:04:11 UTC; 4s ago
    Process: 5093 ExecStart=/usr/bin/env ${PYTHON} /usr/bin/goferd --foreground (code=exited, status=1/FAILURE)
   Main PID: 5093 (code=exited, status=1/FAILURE)
        CPU: 234ms

Sep 05 13:04:10 rhel9.example.com env[5093]:     plugin.start()
Sep 05 13:04:10 rhel9.example.com env[5093]:   File "/usr/lib/python3.9/site-packages/gofer/common.py", line 312, in sfn
Sep 05 13:04:10 rhel9.example.com env[5093]:     return fn(*args, **kwargs)
Sep 05 13:04:10 rhel9.example.com env[5093]:   File "/usr/lib/python3.9/site-packages/gofer/agent/plugin.py", line 317, in start
Sep 05 13:04:10 rhel9.example.com env[5093]:     if self.is_started:
Sep 05 13:04:10 rhel9.example.com env[5093]:   File "/usr/lib/python3.9/site-packages/gofer/agent/plugin.py", line 304, in is_started
Sep 05 13:04:10 rhel9.example.com env[5093]:     return self.scheduler.isAlive()
Sep 05 13:04:10 rhel9.example.com env[5093]: AttributeError: 'Scheduler' object has no attribute 'isAlive'
Sep 05 13:04:11 rhel9.example.com systemd[1]: goferd.service: Main process exited, code=exited, status=1/FAILURE
Sep 05 13:04:11 rhel9.example.com systemd[1]: goferd.service: Failed with result 'exit-code'.


Expected results:


If we are shipping the package and the goferd service, It should be running fine for RHEL 9 as well.


Additional info:




Following fixes the issue on RHEL 9 host.
 
# cd /usr/lib/python3.9/site-packages/gofer/
 
# git init .;git add .;git commit -m 'original state'
 
# vi agent/plugin.py
 
# git diff
diff --git a/agent/plugin.py b/agent/plugin.py
index a3f3c97..ae9d6ba 100644
--- a/agent/plugin.py
+++ b/agent/plugin.py
@@ -301,7 +301,7 @@ class Plugin(object):
 
     @property
     def is_started(self):
-        return self.scheduler.isAlive()
+        return self.scheduler.is_alive()
 
     @property
     def latency(self):

# systemctl restart goferd

# systemctl status goferd -l
● goferd.service - Gofer Agent
     Loaded: loaded (/usr/lib/systemd/system/goferd.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2022-09-05 13:08:12 UTC; 5s ago
   Main PID: 16514 (python3)

Comment 2 Gaurav Talreja 2022-09-27 15:33:07 UTC
Verified.

Tested on Satellite 6.12.0 Snap 12.0
Version: python3-gofer-2.12.5-8.el9sat.noarch

Steps:
1. Setup Satellite 6.12, Enable/Sync dogfood EL9 client repo and register a RHEL9 host
2. Verify EL9 client repo is enabled and this on RHEL9 client
    # grep -nR is_alive /usr/lib/python3.9/site-packages/gofer/agent/plugin.py
    304:        return self.scheduler.is_alive()
3. Install katello-agent and check the status of goferd on the RHEL9 host

Observation:
katello-agent install works and goferd is in running state after install on EL9 host, Package install via katello-agent worked.
Additionally, I tested EL7 and EL8 content hosts with this fix for renaming "isAlive" to "is_alive" is done, and they also worked fine.

Comment 6 errata-xmlrpc 2022-11-16 13:35:39 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.12 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-2022:8506


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