Bug 577034 - rhnreg_ks error during kickstart install
Summary: rhnreg_ks error during kickstart install
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 0.8
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16
TreeView+ depends on / blocked
 
Reported: 2010-03-25 22:08 UTC by Rhett
Modified: 2011-07-25 17:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-25 17:24:50 UTC
Embargoed:


Attachments (Terms of Use)

Description Rhett 2010-03-25 22:08:47 UTC
Description of problem:
I consistently have an error with the dmidecode section while trying to perform a fresh kickstart install of a client machine.  

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

How reproducible:
Use PXE Boot to install new system using Kickstart

Steps to Reproduce:
1. Use CentOS 5.4 Install on Spacewalk 0.8 server
2. Kickstart using PXE Boot
3. Pertains to rhn-setup-0.8.12-1.el5 
  
Actual results:

FINISHED --2010-03-25 16:43:15--
Downloaded: 3 files, 900K in 0.8s (1.17 MB/s)
Preparing...                ##################################################
pyOpenSSL                   ##################################################
rhnlib                      ##################################################
libxml2-python              ##################################################
cp: cannot stat `/tmp/ks-tree-copy/*': No such file or directory
Stopping system message bus: [FAILED]
Starting system message bus: [  OK  ]
Stopping HAL daemon: [FAILED]
Starting HAL daemon: [  OK  ]
--2010-03-25 16:43:21--  http://atl.spacewalk.hidinc.com/pub/RHN-ORG-TRUSTED-SSL-CERT
Resolving atl.spacewalk.hidinc.com... 192.168.1.147
Connecting to atl.spacewalk.hidinc.com|192.168.1.147|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5476 (5.3K) [text/plain]
Saving to: `/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT'

     0K .....                                                 100%  623K=0.009s

2010-03-25 16:43:21 (623 KB/s) - `/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT' saved [5476/5476]

Traceback (most recent call last):
  File "/usr/sbin/rhnreg_ks", line 31, in ?
    from up2date_client import rhnreg
  File "/usr/share/rhn/up2date_client/rhnreg.py", line 21, in ?
    import hardware
  File "/usr/share/rhn/up2date_client/hardware.py", line 35, in ?
    import dmidecode
ImportError: No module named dmidecode
ERROR: unable to read system id.

Expected results:  The kickstart script fails to perform any of the post steps after the rhnreg_ks step fails.  


Additional info:

Comment 1 Gerad Coles 2010-05-14 19:24:52 UTC
Any news on this, or workarounds?

We are having the same issue as this, using Spacewalk 1.0 deployed on CentOS 5.4 x86. We are PXE booting/kickstarting CentOS 5.4 x86_64 with cobbler using Spacewalk to manage the kickstart.

Some relevant snippets from kickstart file:

repo --name=VT --baseurl=http://spacewalklab/ks/dist/CentOS-54-x86_64/VT
key --skip
repo --name=centos54-updates-x86_64 --baseurl=http://spacewalklab/ks/dist/child/centos54-updates-x86_64/CentOS-54-x86_64
repo --name=spacewalk-client-x86_64 --baseurl=http://spacewalklab/ks/dist/child/spacewalk-client-x86_64/CentOS-54-x86_64
repo --name=epel5-x86_64 --baseurl=http://spacewalklab/ks/dist/child/epel5-x86_64/CentOS-54-x86_64

%packages

@ Base

%post --nochroot
mkdir /mnt/sysimage/tmp/ks-tree-copy
if [ -d /oldtmp/ks-tree-shadow ]; then
cp -fa /oldtmp/ks-tree-shadow/* /mnt/sysimage/tmp/ks-tree-copy
elif [ -d /tmp/ks-tree-shadow ]; then
cp -fa /tmp/ks-tree-shadow/* /mnt/sysimage/tmp/ks-tree-copy
fi
cp /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
cp -f /tmp/ks-pre.log /mnt/sysimage/root/

%post
( # Log %post errors
 # --Begin Spacewalk command section--
cat > /tmp/ssl-key-1 <<'EOF'
Certificate:
    Data:
...
EOF
# ssl-key1
cat /tmp/ssl-key-* > /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
perl -npe 's/RHNS-CA-CERT/RHN-ORG-TRUSTED-SSL-CERT/g' -i /etc/sysconfig/rhn/*

mkdir -p /tmp/rhn_rpms/optional
cd /tmp/rhn_rpms/optional
xml2-python-2.6.26-2.1.2.8.x86_64.rpm
ional/libxml2-python*
perl -npe 's|^(\s*serverURL\s*=\s*[^:]+://)[^/]*/|1spacewalklab/|' -i /etc/sysconfig/rhn/up2date
mkdir -p /etc/sysconfig/rhn/allowed-actions/script
touch /etc/sysconfig/rhn/allowed-actions/script/all
mkdir -p /etc/sysconfig/rhn/allowed-actions/configfiles
touch /etc/sysconfig/rhn/allowed-actions/configfiles/all

# now copy from the ks-tree we saved in the non-chroot checkout
cp -fav /tmp/ks-tree-copy/* /
rm -Rf /tmp/ks-tree-copy
# --End Spacewalk command section--

/etc/init.d/messagebus restart
/etc/init.d/haldaemon restart
# begin cobbler snippet
# begin Red Hat management server registration
mkdir -p /usr/share/rhn/
wget http://spacewalklab/pub/RHN-ORG-TRUSTED-SSL-CERT -O /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
perl -npe 's/RHNS-CA-CERT/RHN-ORG-TRUSTED-SSL-CERT/g' -i /etc/sysconfig/rhn/*
a192f0c18438a2cfedb01bfb11418cbf
# end Red Hat management server registration

# end cobbler snippet

rhn_check

) >> /root/ks-post.log 2>&1


In the ks-post.log file, we see this:

...
cp: cannot stat `/tmp/ks-tree-copy/*': No such file or directory
...
Traceback (most recent call last):
  File "/usr/sbin/rhnreg_ks", line 31, in ?
    from up2date_client import rhnreg
  File "/usr/share/rhn/up2date_client/rhnreg.py", line 20, in ?
    import hardware
  File "/usr/share/rhn/up2date_client/hardware.py", line 32, in ?
    import dmidecode
ImportError: No module named dmidecode
ERROR: unable to read system id.

python-dmidecode is in the EPEL repo that is specified in the kickstart. If I try adding that package to the list of packages; however, Anaconda complains that the package is missing in the early part of the install, so I can't get that workaround working (I guess since python-dmidecode is not part of the cobbler CentOS ISO image).

I also have tried installing python-dmidecode with a wget/rpm -Uhv combo in the post scripts, but the post scripts are added too late in the KS to get python-dmidecode installed before rhnreg_ks is run. And pre doesn't seem to be a working option since we aren't actually running in the installed OS yet.

Any help or workarounds would be very appreciated.

Comment 2 Gerad Coles 2010-05-14 20:49:21 UTC
I managed to figure out a workaround for this.

On the spacewalk server, I edited the file /var/lib/cobbler/snippets/redhat_register, adding the following to the beginning of the script:

mkdir -p /tmp/rhn_rpms/optional
cd /tmp/rhn_rpms/optional
wget -P /tmp/rhn_rpms/optional http://$redhat_management_server/download/package/abe601bb2cffbd5ac574e6b567ae7183303a22bf/1273894368985/1/4534/python-dmidecode-3.10.7-3.el5.x86_64.rpm
rpm -Uvh --replacepkgs --replacefiles /tmp/rhn_rpms/optional/python-dmidecode-3.10.7-3.el5.x86_64.rpm

Thus, the python-dmidecode plugin would be installed prior to the rhnreg_ks command being run.

This is a nasty hack but at least it works.

Comment 3 Gerad Coles 2010-05-17 19:09:42 UTC
Note that this solution is particularly bad since the URL that I supplied in the kickstart changes every time the EPEL repository updates (since the path is based on an md5sum).

Comment 4 Rhett 2010-05-17 20:58:13 UTC
Could someone test this: 

mkdir -p /tmp/rhn_rpms/optional
cd /tmp/rhn_rpms/optional
wget -P /tmp/rhn_rpms/optional https://$redhat_management_server/pub/python-dmidecode-latest.el5.x86_64.rpm --no-check-certificate
rpm -Uvh --replacepkgs --replacefiles
/tmp/rhn_rpms/optional/python-dmidecode-latest.el5.x86_64.rpm

Comment 5 Jan Pazdziora 2010-10-27 08:32:28 UTC
Mass-aligning under space12, so that we don't lose track of this bugzilla. This however does not mean that we plan (will be able to) address this bug in Spacewalk 1.2.

Comment 6 Jan Pazdziora 2010-11-19 16:03:12 UTC
Mass-moving to space13.

Comment 7 Tomas Lestach 2011-01-28 14:37:24 UTC
There's not the python-dmidecode dependency issue any more in current nightly. Moving to MODIFIED.

Comment 8 Miroslav Suchý 2011-04-11 07:31:54 UTC
We did not have time for this one during Spacewalk 1.4 time frame. Mass moving to Spacewalk 1.5.

Comment 9 Miroslav Suchý 2011-04-11 07:36:32 UTC
We did not have time for this one during Spacewalk 1.4 time frame. Mass moving to Spacewalk 1.5.

Comment 10 Jan Pazdziora 2011-07-20 11:49:36 UTC
Aligning under space16.

Comment 11 Jan Pazdziora 2011-07-25 17:24:50 UTC
The python-dmidecode is now required by rhn-client-tools, from version 0.8.1-1, and this change is also in RHEL, see bug 546312.

Therefore, I believe the issue was address, and I'm closing this bugzilla as such. Please reopen if you disagree.


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