Bug 1625234 - anamon fails to upload installation logs on RHEL7.6 recipes: ImportError: No module named xmlrpc.client
Summary: anamon fails to upload installation logs on RHEL7.6 recipes: ImportError: No ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: general
Version: 25
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: 26.0
Assignee: Dan Callaghan
QA Contact: Dan Callaghan
URL:
Whiteboard:
: 1631398 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-04 12:52 UTC by Jeff Bastian
Modified: 2018-10-08 02:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-08 02:16:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Jeff Bastian 2018-09-04 12:52:26 UTC
Description of problem:
anamon was updated for RHEL8 and python3 recently (see bug 1619482), but the update has broken older releases like RHEL7.  The serial console log shows:

+ /usr/libexec/platform-python /tmp/anamon --recipe-id 5619971 --xmlrpc-url http://lab-02.rhts.eng.bos.redhat.com:8000/RPC2
Traceback (most recent call last):
  File "/tmp/anamon", line 21, in <module>
    from xmlrpc.client import Server as xmlrpc_server
ImportError: No module named xmlrpc.client


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

How reproducible:
always

Steps to Reproduce:
1. provision a system with a recent snapshot of RHEL-7.6

Actual results:
no anaconda logs are attached to the job
console log shows anamon failed with ImportError: No module named xmlrpc.client

Expected results:
anamon uploads anaconda logs to Beaker

Additional info:

Comment 2 Jeff Bastian 2018-09-04 20:08:47 UTC
Kickstart checks for the presence of /usr/libexec/platform-python when deciding to use anamon or anamon3:

if command -v python3 >/dev/null ; then
   fetch /tmp/anamon http://lab-02.rhts.eng.bos.redhat.com/beaker/anamon3
   python_command="python3"
elif [ -f /usr/libexec/platform-python ] ; then
   fetch /tmp/anamon http://lab-02.rhts.eng.bos.redhat.com/beaker/anamon3
   python_command="/usr/libexec/platform-python"
else
   fetch /tmp/anamon http://lab-02.rhts.eng.bos.redhat.com/beaker/anamon
   python_command="python"
fi


RHEL 7 also has /usr/libexec/platform-python but it is Python 2.x:

[anaconda root@huawei-t2280-06 ~]# /usr/libexec/platform-python
Python 2.7.5 (default, Jul 16 2018, 15:58:59) 
...

Comment 3 Jeff Bastian 2018-09-04 21:05:23 UTC
Untested, but this should work:

...
elif [ -f /usr/libexec/platform-python ] ; then
   if /usr/libexec/platform-python --version 2>&1 | grep -q "Python 2" ; then
      fetch /tmp/anamon http://lab-02.rhts.eng.bos.redhat.com/beaker/anamon
      python_command="python"
   else
      fetch /tmp/anamon http://lab-02.rhts.eng.bos.redhat.com/beaker/anamon3
      python_command="/usr/libexec/platform-python"
   fi
else
...

Comment 4 Jeff Bastian 2018-09-04 21:08:51 UTC
Scratch comment 3.  This is better:

elif [ -f /usr/libexec/platform-python ] && \
     /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
   fetch /tmp/anamon http://lab-02.rhts.eng.bos.redhat.com/beaker/anamon3
   python_command="/usr/libexec/platform-python"
else

Comment 5 Jeff Bastian 2018-09-04 22:28:30 UTC
Patch submitted from idea in comment 4:
https://gerrit.beaker-project.org/6295

Comment 6 Roman Joost 2018-09-04 23:12:12 UTC
Dear Jeff,

many thanks for the patch and the bug report. Is this a blocking issue? It seems the job did pass. We do have an extensive acceptance test suite we've run before the release which didn't uncover this problem. Has platform-python been added to very recent versions of RHEL 7.6?

Comment 7 Jeff Bastian 2018-09-05 12:21:49 UTC
I think this is not blocking since kickstarts generally work fine. If kickstarts fail, though, we won't have the logs to learn why.  Martin, would you consider this a blocker for RTT?


It looks like platform-python is indeed new in RHEL 7.6.  I checked RHEL 7.0 through 7.5 and it did not exist in the LiveOS/squashfs.img, but it does exist in the latest 7.6 composes.

Comment 13 PaulB 2018-09-20 13:51:35 UTC
*** Bug 1631398 has been marked as a duplicate of this bug. ***

Comment 16 Dan Callaghan 2018-09-28 05:56:22 UTC
This bug was fixed on the release-25 branch, but the next release will be Beaker 26.0.

Comment 17 Dan Callaghan 2018-10-08 02:16:36 UTC
Beaker 26.0 has been released.


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