Yubico Forum
https://forum.yubico.com/

[Q?] sporadic '500 Internal Server Error' failures - YubiX
https://forum.yubico.com/viewtopic.php?f=31&t=1399
Page 1 of 1

Author:  jerichod505 [ Tue Jun 10, 2014 12:08 am ]
Post subject:  [Q?] sporadic '500 Internal Server Error' failures - YubiX

I am having occasional (hard to reproduce) errors with the YubiX software stack, where the radtest reply message is ""<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>500 Internal Server Error</title>\n</head><body>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error or\nmisconfiguration and was unable to complete\nyour request""

I searched the forum and found a similar error but not for the reasons I think are happening. In my case simply restarting the freeRADIUS server fixes the issue.

After lots of debugging, it appears that the problem is related to the /usr/share/pyshared/yubiauth/client/rest.py attempting to access the database. the only real clue is the following errors in the Apache log:

[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] mod_wsgi (pid=5449): Exception occurred processing WSGI script '/usr/share/pyshared/yubiauth/client/rest.py'.
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] Traceback (most recent call last):
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] resp = self.call_func(req, *args, **self.kwargs)
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 210, in call_func
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] return self.func(req, *args, **kwargs)
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/share/pyshared/yubiauth/client/rest.py", line 66, in ClientMiddleware
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] response = request.get_response(app)
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/yubiauth/util/controller.py", line 52, in __exit__
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] self.commit()
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/yubiauth/util/controller.py", line 63, in commit
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] self.session.commit()
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 645, in commit
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] self.transaction.commit()
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 317, in commit
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] t[1].commit()
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1977, in commit
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] self._do_commit()
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2007, in _do_commit
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] self.connection._commit_impl()
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1233, in _commit_impl
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] self.engine.dialect.do_commit(self.connection)
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1012, in connection
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] return self._revalidate_connection()
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1018, in _revalidate_connection
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] "Can't reconnect until invalid "
[Thu Jun 05 13:56:08 2014] [error] [client 127.0.0.1] InvalidRequestError: Can't reconnect until invalid transaction is rolled back

i am not quite sure if this is part of the symptoms or the cause, and with all the calls in and out of perl/freeradius/python i am not sure where this error is turning into the 'internal server error' message. one thing for sure is that debugging this tangled stuff is beyond me.

Anybody else seen these issues?

thanks.
jd505

Author:  lshiry [ Wed Jun 18, 2014 2:32 pm ]
Post subject:  Re: [Q?] sporadic '500 Internal Server Error' failures - Yub

I'm also seeing this. It seems random and most of the time it goes away on its own, just trying authentication again succeeds.

Author:  lshiry [ Tue Sep 23, 2014 2:59 pm ]
Post subject:  Re: [Q?] sporadic '500 Internal Server Error' failures - Yub

This was apparently fixed in a recent update from yubico. Works great now, no more 500 errors.

Author:  dain [ Tue Sep 23, 2014 3:21 pm ]
Post subject:  Re: [Q?] sporadic '500 Internal Server Error' failures - Yub

Sorry I missed posting about the fix here! Thanks for the update letting us know it now works for you.

Author:  jerichod505 [ Fri Sep 26, 2014 8:09 pm ]
Post subject:  Re: [Q?] sporadic '500 Internal Server Error' failures - Yub

thanks for the information. i will update my systems and test it, and then post back here afterwards.

r.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/