Database Disk Image Is Malformed: Query Record was not Recorded as Expected #18283
Unanswered
polyfon
asked this question in
Q&A / Help
Replies: 1 comment
-
@linkparabole this looks like a problem with SQLite, can you query it outside of Superset? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
Environment
(please complete the following information):
1.0.1
3.8
10.19.0
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Beta Was this translation helpful? Give feedback.
All reactions