TottiRed777 opened a new issue #16015:
URL: https://github.com/apache/superset/issues/16015
When I close the SuperSet page and log in again, I get an error message:
"This session is in 'prepared' state; No further SQL can be emitted by a button
within this transaction." Wait 2~3 minutes to refresh the page and it will be
back to normal.
### Expected results
I log back in and open the dashboard so I can browse quickly
### Actual results
"This session is in 'prepared' state; No further SQL can be emitted by a
button within this transaction."
#### Screenshots
`}
Sorry, something went wrong
500 - Internal Server Error
Stacktrace
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in
wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1952, in
full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1821, in
handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39,
in reraise
raise value
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in
full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in
dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File
"/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py",
line 109, in wraps
return f(self, *args, **kwargs)
File
"/usr/local/lib/python3.8/site-packages/superset/utils/decorators.py", line 78,
in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/superset/views/core.py", line
1657, in dashboard
dashboard_data = dash.data
File
"/usr/local/lib/python3.8/site-packages/superset/models/dashboard.py", line
238, in data
"slices": [slc.data for slc in self.slices],
File
"/usr/local/lib/python3.8/site-packages/superset/models/dashboard.py", line
238, in <listcomp>
"slices": [slc.data for slc in self.slices],
File "/usr/local/lib/python3.8/site-packages/superset/models/slice.py",
line 191, in data
f"{owner.first_name} {owner.last_name}" for owner in self.owners
File
"/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line
275, in __get__
return self.impl.get(instance_state(instance), dict_)
File
"/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line
674, in get
value = self.callable_(state, passive)
File
"/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line
707, in _load_for_state
return self._emit_lazyload(
File "<string>", line 1, in <lambda>
File
"/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line
848, in _emit_lazyload
q(session)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py",
line 477, in all
return list(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py",
line 380, in __iter__
return q._execute_and_instances(context)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py",
line 3102, in _execute_and_instances
conn = self._get_bind_args(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py",
line 3110, in _get_bind_args
return fn(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py",
line 3096, in _connection_from_session
conn = self.session.connection(**kw)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py",
line 1117, in connection
return self._connection_for_bind(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py",
line 1125, in _connection_for_bind
return self.transaction._connection_for_bind(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py",
line 401, in _connection_for_bind
self._assert_active()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py",
line 275, in _assert_active
raise sa_exc.InvalidRequestError(
sqlalchemy.exc.InvalidRequestError: This session is in 'prepared' state; no
further SQL can be emitted within this transaction.
`
#### How to reproduce the bug
1. Close all superset pages or first login pages on other computers
2. Click on Dashboard
3. See error
### Environment
(please complete the following information):
- superset version: `0.38.0`
- python version: ``
- node.js version: ``
- any feature flags active:
### Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [ ] I have checked the superset logs for python stacktraces and included
it here as text if there are any.
- [ ] I have reproduced the issue with at least the latest released version
of superset.
- [ ] I have checked the issue tracker for the same issue and I haven't
found one similar.
### Additional context
I suspect "session reuse", but I don't know where to modify the source code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]