question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Installation]: Docker-compose with Jupyter - SQLite database error

See original GitHub issue

Installation check

Installation OS

Linux

Installation Method

Docker

Kubernetes Cluster Type

N/A - Docker

MLRun Kit Helm Chart Version

Issue Description

SQLite error inside jupyter container.

Installation Logs

> 2022-08-16 15:35:54,802 [info] Initializing DB data
jupyter_1   | > 2022-08-16 15:35:54,802 [debug] Waiting for database liveness
jupyter_1   | > 2022-08-16 15:35:54,802 [debug] SQLite DB is used, liveness check not needed
jupyter_1   | > 2022-08-16 15:35:54,849 [info] No projects in DB, assuming latest data version: {'exc': OperationalError('(sqlite3.OperationalError) unable to open database file'), 'latest_data_version': 2}
jupyter_1   | > 2022-08-16 15:35:54,878 [info] No projects in DB, assuming latest data version: {'exc': OperationalError('(sqlite3.OperationalError) unable to open database file'), 'latest_data_version': 2}
jupyter_1   | > 2022-08-16 15:35:54,878 [info] Checking if migration is needed: {'is_migration_from_scratch': True, 'is_schema_migration_needed': True, 'is_data_migration_needed': False, 'is_database_migration_needed': False, 'is_backup_needed': False, 'is_migration_needed': False}
jupyter_1   | > 2022-08-16 15:35:54,879 [info] Creating initial data
jupyter_1   | > 2022-08-16 15:35:54,879 [info] Performing schema migration
jupyter_1   | > 2022-08-16 15:35:54,879 [debug] Performing alembic schema migrations
jupyter_1   | > 2022-08-16 15:35:54,890 [warning] Migrations failed, changing API state: {'state': 'migrations_failed'}
jupyter_1   | Traceback (most recent call last):
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3208, in _wrap_pool_connect
jupyter_1   |     return fn()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 301, in connect
jupyter_1   |     return _ConnectionFairy._checkout(self)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 761, in _checkout
jupyter_1   |     fairy = _ConnectionRecord.checkout(pool)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 419, in checkout
jupyter_1   |     rec = pool._do_get()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 259, in _do_get
jupyter_1   |     return self._create_connection()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 247, in _create_connection
jupyter_1   |     return _ConnectionRecord(self)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 362, in __init__
jupyter_1   |     self.__connect()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 605, in __connect
jupyter_1   |     pool.logger.debug("Error on connect(): %s", e)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
jupyter_1   |     compat.raise_(
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
jupyter_1   |     raise exception
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 599, in __connect
jupyter_1   |     connection = pool._invoke_creator(self)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 578, in connect
jupyter_1   |     return dialect.connect(*cargs, **cparams)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 584, in connect
jupyter_1   |     return self.dbapi.connect(*cargs, **cparams)
jupyter_1   | sqlite3.OperationalError: unable to open database file
jupyter_1   | 
jupyter_1   | The above exception was the direct cause of the following exception:
jupyter_1   | 
jupyter_1   | Traceback (most recent call last):
jupyter_1   |   File "/opt/conda/lib/python3.8/runpy.py", line 194, in _run_module_as_main
jupyter_1   |     return _run_code(code, main_globals, None,
jupyter_1   |   File "/opt/conda/lib/python3.8/runpy.py", line 87, in _run_code
jupyter_1   |     exec(code, run_globals)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/mlrun/api/main.py", line 256, in <module>
jupyter_1   |     main()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/mlrun/api/main.py", line 240, in main
jupyter_1   |     init_data()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/mlrun/api/initial_data.py", line 65, in init_data
jupyter_1   |     _perform_schema_migrations(alembic_util)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/mlrun/api/initial_data.py", line 160, in _perform_schema_migrations
jupyter_1   |     alembic_util.init_alembic()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/mlrun/api/utils/db/alembic.py", line 24, in init_alembic
jupyter_1   |     alembic.command.upgrade(self._alembic_config, "head")
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/alembic/command.py", line 294, in upgrade
jupyter_1   |     script.run_env()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/alembic/script/base.py", line 490, in run_env
jupyter_1   |     util.load_python_file(self.dir, "env.py")
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
jupyter_1   |     module = load_module_py(module_id, path)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/alembic/util/compat.py", line 182, in load_module_py
jupyter_1   |     spec.loader.exec_module(module)
jupyter_1   |   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
jupyter_1   |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/mlrun/api/migrations_sqlite/env.py", line 82, in <module>
jupyter_1   |     run_migrations_online()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/mlrun/api/migrations_sqlite/env.py", line 72, in run_migrations_online
jupyter_1   |     with connectable.connect() as connection:
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3162, in connect
jupyter_1   |     return self._connection_cls(self, close_with_result=close_with_result)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 92, in __init__
jupyter_1   |     else engine.raw_connection()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3241, in raw_connection
jupyter_1   |     return self._wrap_pool_connect(self.pool.connect, _connection)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3211, in _wrap_pool_connect
jupyter_1   |     Connection._handle_dbapi_exception_noconnection(
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2061, in _handle_dbapi_exception_noconnection
jupyter_1   |     util.raise_(
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
jupyter_1   |     raise exception
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3208, in _wrap_pool_connect
jupyter_1   |     return fn()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 301, in connect
jupyter_1   |     return _ConnectionFairy._checkout(self)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 761, in _checkout
jupyter_1   |     fairy = _ConnectionRecord.checkout(pool)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 419, in checkout
jupyter_1   |     rec = pool._do_get()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 259, in _do_get
jupyter_1   |     return self._create_connection()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 247, in _create_connection
jupyter_1   |     return _ConnectionRecord(self)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 362, in __init__
jupyter_1   |     self.__connect()
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 605, in __connect
jupyter_1   |     pool.logger.debug("Error on connect(): %s", e)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
jupyter_1   |     compat.raise_(
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
jupyter_1   |     raise exception
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 599, in __connect
jupyter_1   |     connection = pool._invoke_creator(self)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 578, in connect
jupyter_1   |     return dialect.connect(*cargs, **cparams)
jupyter_1   |   File "/opt/conda/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 584, in connect
jupyter_1   |     return self.dbapi.connect(*cargs, **cparams)
jupyter_1   | sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
jupyter_1   | (Background on this error at: http://sqlalche.me/e/14/e3q8)

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
Tankilevitchcommented, Aug 19, 2022

From the current log it seems like the API doesn’t have permission to /home/jovyan/data/breast-cancer-jovyan/111b1248c6084d418408eaa56af7bbce/feature-importance.html. I think I have all the information I need for now, seems like a bug, I’ll verify it locally and will update you how to continue. Thanks @lbonini94

1reaction
Tankilevitchcommented, Aug 19, 2022

@lbonini94 great we have a progress 😃

I think the error you experience now is not related to the error you experienced before, I’ll close this this issue and please open a new one related to the new error. Also if you can please add logs from the API so I could understand better what is going on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sqlite3, OperationalError: unable to open database file
Primary diagnosis: SQLite is unable to open that file for some reason. Checking the obvious reasons why, and in approximate order that I...
Read more >
Senzing - MSSQL based installation error · Issue #105 - GitHub
Describe the bug Unable to complete the installation, getting the below error. senzing-api-server | Operation Failed : G2ConfigMgr.
Read more >
Troubleshooting — JupyterHub 3.1.0 documentation
Try this command: docker run -p 8000:8000 -d --name jupyterhub ... Commonly, the 403 error is caused by resetting the JupyterHub database (either...
Read more >
Why do I get sqlite error, "unable to open database file"?
The solution is to make sure the directory containing the database file also has write access allowed to the process. In my case,...
Read more >
Dockerize your Python script and connect to external SQL ...
Docker installed and switched to using Linux containers; SQL Server instance running. You need to create 3 files: Dockerfile; main.py (which is your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found