Bug 766887 - Java Error when creating user with spacecmd
Summary: Java Error when creating user with spacecmd
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 1.6
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Steven Hardy
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space17
TreeView+ depends on / blocked
 
Reported: 2011-12-12 18:49 UTC by Jason Huddleston
Modified: 2012-03-07 09:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-07 09:55:02 UTC
Embargoed:


Attachments (Terms of Use)

Description Jason Huddleston 2011-12-12 18:49:50 UTC
Description of problem:

When creating a user with the spacecmd command with the --pam switch I get the following error:

spacecmd {SSM:0}> user_create -u testuser -f Test -l User -e jason.huddleston --pam -p testtest
ERROR: com.redhat.rhn.common.translation.TranslationException: Could not find translator for class java.lang.Boolean to class java.lang.Integer

I do not get this error when I leave the --pam switch off. I see this on both of my satellite servers. Have you seen this before? Also, if I leave the password flag off it says it is required. The password should not be required if the pam flag is set. 


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

spacewalk-utils-1.2.1-3.el5sat

How reproducible:

Everytime

Steps to Reproduce:
1. spacecmd
2. user_create -u testuser -f Test -l User -e jason.huddleston --pam -p testtest

user_create -u testuser -f Test -l User -e jason.huddleston -p testtest


Actual results:

spacecmd {SSM:0}> user_create -u testuser -f Test -l User -e jason.huddleston --pam -p testtest
ERROR: com.redhat.rhn.common.translation.TranslationException: Could not find translator for class java.lang.Boolean to class java.lang.Integer


Expected results:

spacecmd {SSM:0}> user_create -u testuser -f Test -l User -e jason.huddleston -p testtest
spacecmd {SSM:0}>


Additional info:

Comment 1 Jan Pazdziora 2011-12-13 11:35:30 UTC
Could you please paste the full traceback from /var/log/tomcat*/catalina.out?

Comment 2 Tomas Lestach 2011-12-13 12:17:43 UTC
Yes, this looks like a spacecmd trouble.

I am able to create new user via client.user.create API with enabled pam authentication without any issues.

Aron, would you take a look, please?

Comment 3 Jason Huddleston 2011-12-13 14:19:17 UTC
If I clear out the catalina.out file and rerun the command below is what I see:

spacecmd {SSM:0}> user_create -u testuser -f Test -l User -e jason.huddleston --pam -p testtest
ERROR: com.redhat.rhn.common.translation.TranslationException: Could not find translator for class java.lang.Boolean to class java.lang.Integer
spacecmd {SSM:0}> exit

root@lnxfdis1:/var/log/tomcat5 # cat catalina.out

Dec 13, 2011 9:17:10 AM redstone.xmlrpc.XmlRpcDispatcher writeError
WARNING: com.redhat.rhn.common.translation.TranslationException: Could not find translator for class java.lang.Boolean to class java.lang.Integer


----
Jay

Comment 4 Jonathan Lewis 2012-01-13 17:15:37 UTC
I'm not a programmer but it appears to an issue in:

/usr/lib/python2.6/site-packages/spacecmd/user.py

Couple of issues I see, there should be case where if pam is set, password should not be required and when pam is set it actually needs to make options.pam=1

quick and dirty work around, below the following:

        if not options.pam:
            options.pam = 0
Add:

        if options.pam:
            options.pam = 1

Password will still be required, hoping this will all get addressed in the next update...

Comment 5 Steven Hardy 2012-02-16 18:14:49 UTC
Fix committed 00345a08e72af8f668107bc8f6a72f9f554fc017 which I think solves this issue

Comment 6 Jan Pazdziora 2012-03-07 09:55:02 UTC
Spacewalk 1.7 has been released:

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes17


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