Issue #358: Postgresql: Can't reconnect until invalid transaction is rolled back (conservancy/kallithea)
André Klitzing
issues-reply at bitbucket.org
Fri Feb 7 11:12:07 UTC 2020
New issue 358: Postgresql: Can't reconnect until invalid transaction is rolled back
https://bitbucket.org/conservancy/kallithea/issues/358/postgresql-cant-reconnect-until-invalid
André Klitzing:
We have a fresh installation of Kallithea 0.5.2 with Postgresql 11. We uses uwsgi and nginx. The WebUI can be used. Sometimes the server throws a “Internal Server Error” if a single user refreshes the Browser multiple times.
Traceback \(most recent call last\):
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/tg/wsgiapp.py", line 82, in **call**
response = self.wrapped\_dispatch\(controller, environ, context\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/tg/appwrappers/errorpage.py", line 104, in **call**
resp = self.next\_handler\(controller, environ, context\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/tg/appwrappers/caching.py", line 54, in **call**
return self.next\_handler\(controller, environ, context\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/tg/appwrappers/session.py", line 71, in **call**
response = self.next\_handler\(controller, environ, context\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/tg/appwrappers/i18n.py", line 71, in **call**
return self.next\_handler\(controller, environ, context\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/tg/wsgiapp.py", line 243, in \_dispatch
return controller\(environ, context\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/kallithea/lib/base.py", line 511, in **call**
ip\_addr=ip\_addr,
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/kallithea/lib/base.py", line 438, in \_determine\_auth\_user
return AuthUser.from\_cookie\(session\_authuser, ip\_addr=ip\_addr\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/kallithea/lib/auth.py", line 563, in from\_cookie
dbuser=UserModel\(\).get\(cookie.get\('user\_id'\)\),
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/kallithea/model/user.py", line 57, in get
return user.get\(user\_id\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 1004, in get
return self.\_get\_impl\(ident, loading.load\_on\_pk\_identity\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 1116, in \_get\_impl
return db\_load\_fn\(self, primary\_key\_identity\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/orm/loading.py", line 284, in load\_on\_pk\_identity
return q.one\(\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3347, in one
ret = self.one\_or\_none\(\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3316, in one\_or\_none
ret = list\(self\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/kallithea/lib/caching\_query.py", line 81, in **iter**
return Query.**iter**\(self\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3389, in **iter**
return self.\_execute\_and\_instances\(context\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3414, in \_execute\_and\_instances
result = conn.execute\(querycontext.statement, self.\_params\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 982, in execute
return meth\(self, multiparams, params\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 293, in \_execute\_on\_connection
return connection.\_execute\_clauseelement\(self, multiparams, params\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1101, in \_execute\_clauseelement
distilled\_params,
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1176, in \_execute\_context
e, util.text\_type\(statement\), parameters, None, None
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1476, in \_handle\_dbapi\_exception
util.raise\_from\_cause\(sqlalchemy\_exception, exc\_info\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 398, in raise\_from\_cause
reraise\(type\(exception\), exception, tb=exc\_tb, cause=cause\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1171, in \_execute\_context
conn = self.\_revalidate\_connection\(\)
File "/opt/kallithea/0.5.2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 457, in \_revalidate\_connection
"Can't reconnect until invalid "
StatementError: \(sqlalchemy.exc.InvalidRequestError\) Can't reconnect until invalid transaction is rolled back
\[SQL: SELECT users.firstname AS users\_firstname, users.email AS users\_email, users.user\_data AS users\_user\_data, users.user\_id AS users\_user\_id, users.username AS users\_username, users.password AS users\_password, users.active AS users\_active, users.admin AS users\_admin, users.lastname AS users\_lastname, users.last\_login AS users\_last\_login, users.extern\_type AS users\_extern\_type, users.extern\_name AS users\_extern\_name, users.api\_key AS users\_api\_key, users.created\_on AS users\_created\_on
FROM users
WHERE users.user\_id = %\(param\_1\)s\]
\[parameters: \[\{'%\(139880833321552 param\)s': 2\}\]\]
More information about the kallithea-general
mailing list