Steps to replicate the issue (include links if applicable):
- Close your browser
- Open your browser
- Visit https://quarry.wmcloud.org/
What happens?:
- error 500 (internal server error)
What should have happened instead?:
- homepage loads
Software version (skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):
- Google Chrome, Windows 10
- was unable to duplicate in Edge, so may be intermittent
- a refresh ALWAYS fixes it on the first try
- different bug but also involves error 500: T333043: [bug] "Internal Server Error" when logging into Quarry
- @dcaro states they have also seen the bug
- relevant logs from T333043#9142222:
Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: [2023-09-05 12:17:57,240] ERROR in app: Exception on / [GET] Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: Traceback (most recent call last): Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: response = self.full_dispatch_request() Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: rv = self.handle_user_exception(e) Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: reraise(exc_type, exc_value, tb) Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: raise value Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: rv = self.dispatch_request() Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: return self.view_functions[rule.endpoint](**req.view_args) Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "./quarry/web/app.py", line 82, in index Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: stats_count_users=global_conn.session.query(User).count(), Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3091, in count Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: return self._from_self(col).enable_eagerloads(False).scalar() Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 2832, in scalar Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: ret = self.one() Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 2809, in one Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: return self._iter().one() Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 2850, in _iter Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: execution_options={"_sa_orm_load_options": self.load_options}, Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1689, in execute Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: result = conn._execute_20(statement, params or {}, execution_options) Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1583, in _execute_20 Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: return meth(self, args_10style, kwargs_10style, execution_options) Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 324, in _execute_on_connection Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: self, multiparams, params, execution_options Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1462, in _execute_clauseelement Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: cache_hit=cache_hit, Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1669, in _execute_context Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: conn = self._revalidate_connection() Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 560, in _revalidate_connection Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: self._invalid_transaction() Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: File "/srv/quarry/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 540, in _invalid_transaction Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: code="8s2b", Sep 05 12:17:57 quarry-web-02 uwsgi-quarry-web[1780]: sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid transaction is rolled back. (Background on this error at: https://sqlalche.me/e/14/8s2b)