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
|