linkparabole opened a new issue #13639:
URL: https://github.com/apache/superset/issues/13639
Every time I try running a query in SQLLab I receive the following error:
`
sqlite3.DatabaseError: database disk image is malformed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File
"/home/pcuser/venv/lib/python3.8/site-packages/superset/views/core.py", line
2508, in sql_json_exec
session.flush()
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line
2536, in flush
self._flush(objects)
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line
2678, in _flush
transaction.rollback(_capture_exception=True)
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py",
line 68, in __exit__
compat.raise_(
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line
182, in raise_
raise exception
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line
2638, in _flush
flush_context.execute()
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py",
line 422, in execute
rec.execute(self)
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py",
line 586, in execute
persistence.save_obj(
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py",
line 239, in save_obj
_emit_insert_statements(
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py",
line 1135, in _emit_insert_statements
result = cached_connections[connection].execute(
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line
1011, in execute
return meth(self, multiparams, params)
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/sql/elements.py",
line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line
1124, in _execute_clauseelement
ret = self._execute_context(
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line
1316, in _execute_context
self._handle_dbapi_exception(
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line
1510, in _handle_dbapi_exception
util.raise_(
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line
182, in raise_
raise exception
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line
1276, in _execute_context
self.dialect.do_execute(
File
"/home/pcuser/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py",
line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is
malformed
[SQL: INSERT INTO "query" (extra_json, client_id, database_id,
tmp_table_name, tmp_schema_name, user_id, status, tab_name, sql_editor_id,
schema, sql, select_sql, executed_sql, "limit", select_as_cta,
select_as_cta_used, ctas_method, progress, rows, error_message, results_key,
start_time, start_running_time, end_time, end_result_backend_time,
tracking_url, changed_on) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('{}', 'hecOT_KU5', 2, '', 'dbo', '1', <QueryStatus.RUNNING:
'running'>, 'Query dbo.Query dbo.admin ds-Signals/Full - General ( METER
exclusive)-

03/10/2021 07:57:17', '4jVFSPyE-t', 'dbo', "SELECT optimized.name,
optimized.signalname, origin.signalname as signame2, optimized.optval,
optimized.DateCreatedUTC, optimized.WeekDay, optimized. ... (1985 characters
truncated) ... ed.WeekDay=origin.weekday2\r\nWhere optimized.testerr =
origin.test \r\n\r\nAND optimized.DateCreatedUTC > DATEADD(dd, -7,
GetDate())\r\n\r\n\r\n\t\r", None, None, None, 0, 0, 'TABLE', 0, None, None,
None, None, None, None, None, '2021-03-16 05:56:20.511112')]
(Background on this error at: http://sqlalche.me/e/13/4xp6)`
###Actual Results
Even when I try a simple SELECT * FROM ____ I get a "Query Record was not
recorded as expected" with an instant timeout.
The issue just started happening last week. Oddly enough the current
dashboard seems to be pulling data from the datasource fine, SQLLab however
cannot.
Worth mentioning that SQL Lab recognizes the tables in my database, just
cannot pull any of it.
#### Screenshots
If applicable, add screenshots to help explain your problem.
#### How to reproduce the bug
1. Go to SQL LAB
2. Type in Query
3. Run Query
### Environment
(please complete the following information):
- superset version: `1.0.1`
- python version: `3.8`
- node.js version: `10.19.0`
### Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stack traces and included
it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version
of superset.
- [x] I have checked the issue tracker for the same issue and I haven't
found one similar.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]