Db throwing errors on setup #25

Closed
opened 2026-10-04 23:09:18 +02:00 by adam · 5 comments
Owner

Running docker compose --profile migrate run --rm db-migrate
Returns a permissions issue

Running docker compose --profile migrate run --rm db-migrate Returns a permissions issue <!-- github-sync-id:3801110097 -->
adam closed this issue 2026-10-04 23:09:18 +02:00
Author
Owner

What is the error?

What is the error? <!-- github-comment-id:3739732576 -->
Author
Owner

command.upgrade(alembic_cfg, revision) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.13/site-packages/alembic/command.py", line 483, in upgrade script.run_env() ~~~~~~~~~~~~~~^^ File "/opt/venv/lib/python3.13/site-packages/alembic/script/base.py", line 545, in run_env util.load_python_file(self.dir, "env.py") ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 116, in load_python_file module = load_module_py(module_id, path) File "/opt/venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 136, in load_module_py spec.loader.exec_module(module) # type: ignore ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ File "", line 1023, in exec_module File "", line 488, in _call_with_frames_removed File "/app/alembic/env.py", line 97, in run_migrations_online() ~~~~~~~~~~~~~~~~~~~~~^^ File "/app/alembic/env.py", line 75, in run_migrations_online configuration["sqlalchemy.url"] = get_database_url() ~~~~~~~~~~~~~~~~^^ File "/app/alembic/env.py", line 38, in get_database_url db_path.parent.mkdir(parents=True, exist_ok=True)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/pathlib/_local.py", line 722, in mkdir os.mkdir(self, mode)


I have followed the guide and copied the .env file added my broker settings but left the default paths for folders

<!-- github-comment-id:3741173756 -->
command.upgrade(alembic_cfg, revision) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.13/site-packages/alembic/command.py", line 483, in upgrade script.run_env() ~~~~~~~~~~~~~~^^ File "/opt/venv/lib/python3.13/site-packages/alembic/script/base.py", line 545, in run_env util.load_python_file(self.dir, "env.py") ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 116, in load_python_file module = load_module_py(module_id, path) File "/opt/venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 136, in load_module_py spec.loader.exec_module(module) # type: ignore ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ File "<frozen importlib._bootstrap_external>", line 1023, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/app/alembic/env.py", line 97, in <module> run_migrations_online() ~~~~~~~~~~~~~~~~~~~~~^^ File "/app/alembic/env.py", line 75, in run_migrations_online configuration["sqlalchemy.url"] = get_database_url() ~~~~~~~~~~~~~~~~^^ File "/app/alembic/env.py", line 38, in get_database_url db_path.parent.mkdir(parents=True, exist_ok=True) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/pathlib/_local.py", line 722, in mkdir os.mkdir(self, mode) ~~~~~~~~^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: '/data/collector' I have followed the guide and copied the .env file added my broker settings but left the default paths for folders <!-- github-comment-id:3741173756 -->
Author
Owner

I experienced a very similar issue.
In my case, the problem was resolved by manually creating the collector directory inside ./data, then creating an empty SQLite database file meshcore.db inside that directory, and finally setting proper permissions on both the directory and the database file.

I experienced a very similar issue. In my case, the problem was resolved by manually creating the collector directory inside ./data, then creating an empty SQLite database file meshcore.db inside that directory, and finally setting proper permissions on both the directory and the database file. <!-- github-comment-id:3746070513 -->
Author
Owner

This sorted it out for me thank you very much.
I'll list what I did here in case it helps someone else.

cd meshcore-hub
mkdir data/collector
sqlite3 data/collector/meshcore.db
.database
.exit
chmod 777 data/collector/meshcore.db (not the right way but it worked)
docker compose --profile core up

This sorted it out for me thank you very much. I'll list what I did here in case it helps someone else. cd meshcore-hub mkdir data/collector sqlite3 data/collector/meshcore.db .database .exit chmod 777 data/collector/meshcore.db (not the right way but it worked) docker compose --profile core up <!-- github-comment-id:3747003345 -->
Author
Owner

Thanks for reporting the issue and to those who offered solutions. This should now be fixed (#66) and available as v0.5.2

Thanks for reporting the issue and to those who offered solutions. This should now be fixed (#66) and available as v0.5.2 <!-- github-comment-id:3756139519 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/meshcore-hub#25