Bug 765790 - Wrong exception handling when registering with wrong credentials
Summary: Wrong exception handling when registering with wrong credentials
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 1.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16 765840
TreeView+ depends on / blocked
 
Reported: 2011-12-09 12:50 UTC by Šimon Lukašík
Modified: 2011-12-13 09:06 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
: 765840 (view as bug list)
Environment:
Last Closed: 2011-12-13 09:06:07 UTC
Embargoed:


Attachments (Terms of Use)
Behaviour of version rhn-setup-0.4.20-56.el5 (1.07 KB, text/plain)
2011-12-09 13:34 UTC, Šimon Lukašík
no flags Details
Behaviour of version rhn-setup-1.6.39-1.el5 (400 bytes, text/plain)
2011-12-09 13:35 UTC, Šimon Lukašík
no flags Details

Description Šimon Lukašík 2011-12-09 12:50:36 UTC
Description of problem:
There is a regression in a way, how the exceptions are handled
in the rhn-client-tools.

Previously, the error message was printed-out to the console.
Currently, only the name of exception is printed-out.

Version-Release number of selected component (if applicable):
rhn-client-tools-1.6.39-1.el5

How reproducible:
deterministic

Steps to Reproduce:
1. Register with wrong credentials
  # rhnreg_ks -v --username=admin --password=AAAAAA

Actual results:
An error has occurred:
exceptions.AttributeError
See /var/log/up2date for more information


Expected results:
Nice error message. Like in the old times.

Additional info:

Comment 1 Jan Pazdziora (Red Hat) 2011-12-09 13:09:06 UTC
I don't see it:

# rhnreg_ks -v --username asdf --password asdf --serverUrl http://localhost/XMLRPC > /dev/null
An error has occurred:
up2date_client.up2dateErrors.PasswordMinLengthError
See /var/log/up2date for more information
# rpm -qf /usr/sbin/rhnreg_ks
rhn-setup-1.6.39-1.el5
#

Comment 2 Jan Pazdziora (Red Hat) 2011-12-09 13:09:49 UTC
Can you please paste the content of /var/log/up2date?

Comment 3 Jan Pazdziora (Red Hat) 2011-12-09 13:32:15 UTC
With stock RHEL 5 packages, the traceback is even worse, so I'm at loss what nice error message you have in mind:

# rpm -qf /usr/sbin/rhnreg_ks 
rhn-setup-0.4.20-74.el5
# rhnreg_ks -v --username asdf --password asdf --serverUrl http://localhost/XMLRPC --force
An error has occurred:
up2date_client.up2dateErrors.AuthenticationOrAccountCreationError
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/share/rhn/up2date_client/rhncli.py", line 208, in __exceptionHandler
    log.log_exception(type, value, tb)
  File "/usr/share/rhn/up2date_client/up2dateLog.py", line 50, in log_exception
    output.append("%s: %s\n" % (type, value))
  File "/usr/lib/python2.4/site-packages/yum/Errors.py", line 32, in __str__
    return "%s" %(self.value,)
AttributeError: AuthenticationOrAccountCreationError instance has no attribute 'value'

Original exception was:
Traceback (most recent call last):
  File "/usr/sbin/rhnreg_ks", line 227, in ?
    cli.run()
  File "/usr/share/rhn/up2date_client/rhncli.py", line 66, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhnreg_ks", line 95, in main
    self.options.password)
  File "/usr/share/rhn/up2date_client/rhnreg.py", line 301, in reserveUser
    return s.registration.reserve_user(username, password)
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 52, in __call__
    raise self.__exception_from_fault(f)
up2date_client.up2dateErrors.AuthenticationOrAccountCreationError

Comment 4 Šimon Lukašík 2011-12-09 13:34:45 UTC
Created attachment 544544 [details]
Behaviour of version rhn-setup-0.4.20-56.el5

Attached please find a snippet from /var/log/up2date.

# rhnreg_ks -v --username=admin --password=nimda  --force
An error has occurred:

Error Class Code: 3
Error Class Info: This login is already taken, or the password is incorrect.
Explanation: 
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

See /var/log/up2date for more information

Comment 5 Šimon Lukašík 2011-12-09 13:35:17 UTC
Created attachment 544545 [details]
Behaviour of version rhn-setup-1.6.39-1.el5

Attached please find a snippet from /var/log/up2date.

# rhnreg_ks -v --username=admin --password=nimda  --force
An error has occurred:
exceptions.AttributeError
See /var/log/up2date for more information

Comment 8 Miroslav Suchý 2011-12-12 14:33:13 UTC
I could not reproduce it with 
rhn-setup-1.6.40-1.el6.noarch
and
spacewalk-backend.noarch 0:1.6.57-1.el5 
Can you please provide me with machine where this happen?

Comment 9 Šimon Lukašík 2011-12-13 07:48:25 UTC
I do no longer see the problem with rhn-client-tools-1.6.41-1.

Neither on RHEL 5 nor on Fedora 15.


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