graphql-python / graphql-python/graphql-core-legacy
sqlalchemy.exc.InvalidRequestError: Can't reconnect until invalid transaction is rolled back
- Vorherrschende Sprache
- Python
- Sterne
- 372
- Forks
- 175
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
i get the following error, it lost connection once a while and not able to reconnect.
sqlalchemy.exc.InvalidRequestError: Can't reconnect until invalid transaction is rolled back
2017-05-25 21:20:40 +0000] [1034] [DEBUG] Closing connection.
[2017-05-25 21:20:42 +0000] [1034] [DEBUG] GET /graphiql
[2017-05-25 21:20:42 +0000] [1034] [DEBUG] Closing connection.
[2017-05-25 21:20:42 +0000] [1032] [DEBUG] GET /graphiql/graphiql.css
[2017-05-25 21:20:42 +0000] [1033] [DEBUG] GET /graphiql/graphiql.min.js
[2017-05-25 21:20:42 +0000] [1032] [DEBUG] Closing connection.
[2017-05-25 21:20:42 +0000] [1033] [DEBUG] Closing connection.
[2017-05-25 21:20:44 +0000] [1033] [DEBUG] POST /graphql
[2017-05-25 21:20:44 +0000] [1033] [DEBUG] Closing connection.
[2017-05-25 21:20:48 +0000] [1034] [DEBUG] POST /graphql
ERROR:graphql.execution.executor:An error occurred while resolving field Query.focusInCoworkerById
Traceback (most recent call last):
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1112, in _execute_context
conn = self.__connection
AttributeError: 'Connection' object has no attribute '_Connection__connection'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1114, in _execute_context
conn = self._revalidate_connection()
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 424, in _revalidate_connection
"Can't reconnect until invalid "
sqlalchemy.exc.InvalidRequestError: Can't reconnect until invalid transaction is rolled back
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/venv3/lib/python3.4/site-packages/graphql/execution/executor.py", line 200, in resolve_or_error
return executor.execute(resolve_fn, source, args, context, info)
File "/app/venv3/lib/python3.4/site-packages/graphql/execution/executors/sync.py", line 7, in execute
return fn(*args, **kwargs)
File "/app/ql/dao/schema.py", line 340, in resolve_focusInCoworkerById
return queryfocusInCoworker.filter_by(hubot_id=args.get('coworker_id')).all()
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2703, in all
return list(self)
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2855, in __iter__
return self._execute_and_instances(context)
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 945, in execute
return meth(self, multiparams, params)
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1121, in _execute_context
None, None)
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
exc_info
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
raise value.with_traceback(tb)
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1114, in _execute_context
conn = self._revalidate_connection()
File "/app/venv3/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 424, in _revalidate_connection
"Can't reconnect until invalid "
sqlalchemy.exc.StatementError: (sqlalchemy.exc.InvalidRequestError) Can't reconnect until invalid transaction is rolled back [SQL: 'SELECT dashboard_hubot_vitals.id AS dashboard_hubot_vitals_id, dashboard_hubot_vitals.vital_id AS dashboard_hubot_vitals_vital_id, dashboard_hubot_vitals.hubot_id AS dashboard_hubot_vitals_hubot_id \nFROM dashboard_hubot_vitals \nWHERE dashboard_hubot_vitals.hubot_id = %s'] [parameters: [{}]]
[2017-05-25 21:20:48 +0000] [1034] [DEBUG] Closing connection.
[2017-05-25 21:20:49 +0000] [1032] [DEBUG] POST /graphql
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne mit dem Traceback und dem Resolver in /app/ql/dao/schema.py bei resolve_focusInCoworkerById und ermittle anschließend, ob der Fehler in graphql-core oder in der SQLAlchemy-Transaktionsverwaltung der Anwendung liegt. Reproduziere das Szenario eines verlorenen Verbindungsabbruchs und erstelle einen Minimalfall, bevor du einen bestätigten Fix identifizierst oder die Zuständigkeitsgrenze dokumentierst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, sqlalchemy
- Bereich
- api, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 20/100