V4 Beta data selection exception


#1

Hello,

I am currently using version 2 and now installed version 4 beta for testing. I ran a simple select query on presto. query got completed from presto end but got below exception on redash

Error running query: (psycopg2.IntegrityError) null value in column “data” violates not-null constraint DETAIL: Failing row contains (3, 1, 1, 57171c8ea294c689cdcb612de1cdc636, SELECT * FROM sometable LIMIT 1000000, null, 113.522103071213, 2018-02-20 09:24:01.495115+00).

I can run same query successfully on version 2.


#2

For some reason it tries to store an invalid object, when running the query.I looked at the Presto query runner and I can’t see a code path where it will try to store None as the data.

But can you verify that you can connect to Presto from the new Redash instance and check the logs for any errors?


#3

I can connect to presto. I can run my other queries. portion of log file attached.

Blockquote
warnings.warn(CDeprecationWarning(W_PICKLE_DEPRECATED))
[2018-02-20 09:12:30,227][PID:615][WARNING][MainProcess] celery@ip-10-0-8-31 ready.
[2018-02-20 09:21:08,195][PID:615][ERROR][MainProcess] Task redash.tasks.execute_query[01ac92eb-c5df-409c-af2f-50579fa402cc] raised unexpected: IntegrityError(’(psycopg2.IntegrityError) null value in colu$
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/celery/app/trace.py”, line 240, in trace_task
R = retval = fun(*args, **kwargs)
File “/opt/redash/redash.4.0.0-beta.b3690/redash/worker.py”, line 71, in call
return TaskBase.call(self, *args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/celery/app/trace.py”, line 438, in protected_call
return self.run(*args, **kwargs)
File “/opt/redash/redash.4.0.0-beta.b3690/redash/tasks/queries.py”, line 522, in execute_query
scheduled_query).run()
File “/opt/redash/redash.4.0.0-beta.b3690/redash/tasks/queries.py”, line 474, in run
run_time, utils.utcnow())
File “/opt/redash/redash.4.0.0-beta.b3690/redash/models.py”, line 764, in store_result
for q in queries:
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2796, in iter
self.session._autoflush()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 1373, in _autoflush
util.raise_from_cause(e)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 1363, in _autoflush
self.flush()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2137, in flush
self._flush(objects)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2257, in _flush
transaction.rollback(_capture_exception=True)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py”, line 60, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2221, in _flush
flush_context.execute()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py”, line 389, in execute
rec.execute(self)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py”, line 548, in execute
uow
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py”, line 181, in save_obj
return self.run(*args, **kwargs)
File “/opt/redash/redash.4.0.0-beta.b3690/redash/tasks/queries.py”, line 522, in execute_query
scheduled_query).run()
File “/opt/redash/redash.4.0.0-beta.b3690/redash/tasks/queries.py”, line 474, in run
run_time, utils.utcnow())
File “/opt/redash/redash.4.0.0-beta.b3690/redash/models.py”, line 764, in store_result
for q in queries:
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2796, in iter
self.session._autoflush()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 1373, in _autoflush
util.raise_from_cause(e)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 1363, in _autoflush
self.flush()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2137, in flush
self._flush(objects)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2257, in _flush
transaction.rollback(_capture_exception=True)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py”, line 60, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2221, in _flush
flush_context.execute()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py”, line 389, in execute
rec.execute(self)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py”, line 548, in execute
uow
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py”, line 181, in save_obj
mapper, table, insert)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py”, line 835, in _emit_insert_statements
execute(statement, params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 945, in execute
return meth(self, multiparams, params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1189, in _execute_context
context)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1393, in _handle_dbapi_exception
exc_info
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1182, in _execute_context
context)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 469, in do_execute
cursor.execute(statement, parameters)
IntegrityError: (psycopg2.IntegrityError) null value in column “data” violates not-null constraint
DETAIL: Failing row contains (2, 1, 1, 57171c8ea294c689cdcb612de1cdc636, SELECT *
FROM careem.trip LIMIT 1000000, null, 117.970770835876, 2018-02-20 09:21:08.172867+00).
[SQL: ‘INSERT INTO query_results (org_id, data_source_id, query_hash, query, data, runtime, retrieved_at) VALUES (%(org_id)s, %(data_source_id)s, %(query_hash)s, %(query)s, %(data)s, %(runtime)s, %(retri$
[2018-02-20 09:24:01,504][PID:615][ERROR][MainProcess] Task redash.tasks.execute_query[367a140c-7151-4d6a-9796-c14941979815] raised unexpected: IntegrityError(’(psycopg2.IntegrityError) null value in colu$
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/celery/app/trace.py”, line 240, in trace_task
R = retval = fun(*args, **kwargs)
File “/opt/redash/redash.4.0.0-beta.b3690/redash/worker.py”, line 71, in call
return TaskBase.call(self, *args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py”, line 835, in _emit_insert_statements
execute(statement, params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 945, in execute
return meth(self, multiparams, params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1189, in _execute_context
context)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1393, in _handle_dbapi_exception
exc_info
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1182, in _execute_context
context)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 469, in do_execute
cursor.execute(statement, parameters)
IntegrityError: (psycopg2.IntegrityError) null value in column “data” violates not-null constraint
DETAIL: Failing row contains (2, 1, 1, 57171c8ea294c689cdcb612de1cdc636, SELECT *
FROM careem.trip LIMIT 1000000, null, 117.970770835876, 2018-02-20 09:21:08.172867+00).
[SQL: ‘INSERT INTO query_results (org_id, data_source_id, query_hash, query, data, runtime, retrieved_at) VALUES (%(org_id)s, %(data_source_id)s, %(query_hash)s, %(query)s, %(data)s, %(runtime)s, %(retri$
[2018-02-20 09:24:01,504][PID:615][ERROR][MainProcess] Task redash.tasks.execute_query[367a140c-7151-4d6a-9796-c14941979815] raised unexpected: IntegrityError(’(psycopg2.IntegrityError) null value in colu$
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/celery/app/trace.py”, line 240, in trace_task
R = retval = fun(*args, **kwargs)
File “/opt/redash/redash.4.0.0-beta.b3690/redash/worker.py”, line 71, in call
return TaskBase.call(self, *args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/celery/app/trace.py”, line 438, in protected_call
return self.run(*args, **kwargs)
File “/opt/redash/redash.4.0.0-beta.b3690/redash/tasks/queries.py”, line 522, in execute_query
scheduled_query).run()
File “/opt/redash/redash.4.0.0-beta.b3690/redash/tasks/queries.py”, line 474, in run
run_time, utils.utcnow())
File “/opt/redash/redash.4.0.0-beta.b3690/redash/models.py”, line 764, in store_result
for q in queries:
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2796, in iter
self.session._autoflush()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 1373, in _autoflush
util.raise_from_cause(e)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 1363, in _autoflush
self.flush()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2137, in flush
self._flush(objects)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2257, in _flush
transaction.rollback(_capture_exception=True)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py”, line 60, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py”, line 2221, in _flush
flush_context.execute()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py”, line 389, in execute
rec.execute(self)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py”, line 548, in execute
uow
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py”, line 181, in save_obj