Hide Forgot
Description of problem: Running subscription-manager register in kickstart in post section (in chrooted environment) shows error and gives 0 as exit code. Version-Release number of selected component (if applicable): subscription-manager-0.95.11-1.el6 How reproducible: always Steps to Reproduce: 1. create kickstart with post section looking like this: %post echo "subscription-manager output:" > /root/subscription-manager.txt subscription-manager register --username SOMEUSERNAME --password SOMEPASSWORD >> /root/subscription-manager.txt 2>&1 echo "subscription-manager return code: $?" >> /root/subscription-manager.txt %end 2. use such kickstart 3. cat /root/subscription-manager.txt Actual results: subscription-manager output: 'NoneType' object has no attribute 'lower' subscription-manager return code: 0 Expected results: subscription-manager output: some-identifier machine_hostname subscription-manager return code: 0 Additional info:
I have a same problem. I workarounded it with an export LANG="en_US.UTF-8" command. The bug is easy reproductable: [root@tesla16 ~]# subscription-manager register This system is already registered. Use --force to override [root@tesla16 ~]# LANG=C subscription-manager register 'NoneType' object has no attribute 'lower' LANG=C was used during install and subscription-manager doesn't work with it.
This may already have been fixed by related bug 700601 bug 702403 bug 702078
This has been fixed as John Sefler has stated in comment 4.
Reproducing failure on broken version (from rhel61)... [root@rhsm-compat-rhel61 ~]# rpm -q subscription-manager subscription-manager-0.95.17-1.el6_1.x86_64 [root@rhsm-compat-rhel61 ~]# LANG=C subscription-manager register 'NoneType' object has no attribute 'lower' [root@rhsm-compat-rhel61 ~]# echo $? 255 [root@rhsm-compat-rhel61 ~]# Verifying fix on latest version (targeting rhel63)... [root@jsefler-r63-workstation ~]# rpm -q subscription-manager subscription-manager-0.99.9-1.el6.x86_64 [root@jsefler-r63-workstation ~]# LANG=C subscription-manager register Username: qa Password: The system has been registered with id: f57f013a-f092-43f6-b9f2-820eb43b8a8c [root@jsefler-r63-workstation ~]# echo $? 0 [root@jsefler-r63-workstation ~]# moving to VERIFIED
Note: If registering from from within the kickstart, you could specify the username and password [and org] as demonstrated in comment 0 [root@jsefler-r63-workstation ~]# LANG=C subscription-manager register --username SOMEUSERNAME --password SOMEPASSWORD 1>/tmp/stdout 2>/tmp/stderr [root@jsefler-r63-workstation ~]# echo $? 0 [root@jsefler-r63-workstation ~]# cat /tmp/stdout The system has been registered with id: b9a10105-977a-4d50-b37d-2ed05fbad50f [root@jsefler-r63-workstation ~]# cat /tmp/stderr [root@jsefler-r63-workstation ~]# ^^ This demonstrates that registration with username and password supplied as parameters explicitly using the default fallback C local now works.
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, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0804.html