Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging in with wrong password raises a TypeError #330

Closed
cd1 opened this issue Feb 28, 2014 · 1 comment
Closed

Logging in with wrong password raises a TypeError #330

cd1 opened this issue Feb 28, 2014 · 1 comment
Labels

Comments

@cd1
Copy link
Member

cd1 commented Feb 28, 2014

When I type a wrong password when trying to log in to Kimchi, the following stack trace can be seen in the console:

[28/Feb/2014:15:44:11] HTTP 
Request Headers:
  Content-Length: 36
  COOKIE: kimchi=0828f8a4cc32d89b62821802c7396ccec58e67f0; userid=vianac
  HOST: localhost:8000
  ORIGIN: http://localhost:8000
  CONNECTION: keep-alive
  Remote-Addr: 127.0.0.1
  ACCEPT: application/json, text/javascript, */*; q=0.01
  USER-AGENT: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36
  X-REQUESTED-WITH: XMLHttpRequest
  ACCEPT-LANGUAGE: en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4,de;q=0.2
  Content-Type: application/json
  REFERER: http://localhost:8000/
  ACCEPT-ENCODING: gzip,deflate,sdch
[28/Feb/2014:15:44:11] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/home/vianac/LTC/kimchi/src/kimchi/root.py", line 109, in login
    user_info = auth.login(userid, password)
  File "/home/vianac/LTC/kimchi/src/kimchi/auth.py", line 165, in login
    if not authenticate(userid, password):
  File "/home/vianac/LTC/kimchi/src/kimchi/auth.py", line 111, in authenticate
    raise OperationFailed("KCHAUTH0001E", msg_args)
  File "/home/vianac/LTC/kimchi/src/kimchi/exception.py", line 33, in __init__
    msg = self._get_translation(args)
  File "/home/vianac/LTC/kimchi/src/kimchi/exception.py", line 54, in _get_translation
    args[key] = unicode(value, 'utf-8')
TypeError: coercing to Unicode: need string or buffer, int found

This bug is always reproducible for me. It happens with "root", any non-root user and any non-existing user. Typing a wrong password seems to trigger the bug.

I am running Fedora 20 x86_64, Chrome 33.0.1750.117, libvirt-1.1.3.3-5.fc20.x86_64, Kimchi commit 5d82241.

@adamkingit adamkingit added the bug label Mar 3, 2014
@alinefm
Copy link
Member

alinefm commented Mar 4, 2014

Patch on mail list: [PATCH] issue #330: Properly log the error message when login fails

alinefm added a commit that referenced this issue Mar 6, 2014
… unicode

The unicode() operation is only available for strings.
So make sure the exception argument is a string before converting it to
unicode.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
@alinefm alinefm closed this as completed Mar 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants