Aaron Hoffer
11/04/2022, 7:10 PMv1.0.16
and getting sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.
errors, however I’m running it in k8s using a postgres backend for jobs/schedules/etc. My jobs are using in memory output storage and I did notice this recent change https://github.com/dagster-io/dagster/pull/10154 and the exceptions are happening in the pods generated for the kubernetes jobs. The jobs seem to complete fine but I’m getting at least one exception per run.Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 753, in _finalize_fairy
fairy._reset(pool)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1004, in _reset
pool._dialect.do_rollback(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 683, in do_rollback
dbapi_connection.rollback()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139621353035584 and this is thread id 139620698298112. Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 753, in _finalize_fairy
fairy._reset(pool)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1004, in _reset
pool._dialect.do_rollback(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 683, in do_rollback
dbapi_connection.rollback()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139621353035584 and this is thread id 139620698298112.
prha
11/04/2022, 7:33 PMAaron Hoffer
11/04/2022, 7:35 PMlocal_artifact_storage:
module: dagster._core.storage.root
class: LocalArtifactStorage
config:
base_dir: /opt/dagster/dagster_home
run_storage:
module: dagster_postgres.run_storage
class: PostgresRunStorage
event_log_storage:
module: dagster_postgres.event_log
class: PostgresEventLogStorage
config:
compute_logs:
module: dagster._core.storage.noop_compute_log_manager
class: NoOpComputeLogManager
config: {}
schedule_storage:
module: dagster_postgres.schedule_storage
class: PostgresScheduleStorage
config:
Are you executing anything in process asYes I’m using the
in_process_executor
Exception closing connection <sqlite3.Connection object at 0x7f1ed40a2e40>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 753, in _finalize_fairy
fairy._reset(pool)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1004, in _reset
pool._dialect.do_rollback(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 683, in do_rollback
dbapi_connection.rollback()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139770470790976 and this is thread id 139769816073984.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 255, in _close_connection
self._dialect.do_terminate(connection)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 689, in do_terminate
self.do_close(dbapi_connection)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 692, in do_close
dbapi_connection.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139770470790976 and this is thread id 139769816073984.
prha
11/04/2022, 8:10 PMmy_job.execute_in_process()
mem_io_manager
which it sounds like you’re using and does not use SQLite.Aaron Hoffer
11/04/2022, 8:17 PMrun_monitoring
on (only other random config I could think of)Issac Loo
11/29/2022, 5:21 PMAlexander Osipov
12/03/2022, 7:54 AM@sensor(job=...)
def some_sensor():
with build_resources({'some_db': pg_database}) as resources:
...
As I see calling build_resources
with no instance
argument creates DagsterInstance
using DagsterInstance.ephemeral()
method. In this method InMemoryRunStorage
and InMemoryEventLogStorage
uses. They use sqlite during initialization.@sensor(job=...)
def some_sensor(context):
with build_resources(
{'some_db': pg_database},
instance=context.instance,
) as resources:
...
prha
12/07/2022, 12:12 AMNicolas May
12/07/2022, 11:43 AMprha
12/08/2022, 10:44 PM1.1.6
. Thanks everyone!