-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostgreSQL error? #427
Comments
thank you for reporting this 🎉 . |
ah...I had the same error trying to install from scratch with Nix etc. Wondering if my environment might be missing something. |
Hello, I was also encountering this problem with the docker setup, and I couldn't get a local setup with nix running consistently (it actually started once, but crashed on subsequent attempts with errors about the db socket). The issue with the docker setup is that here:
I tried to adjust the current user through the dockerfile but I'm not familiar at all with Nix and don't feel ready to dive into all this at the moment (couldn't figure out how to get access to However as a workaround it works just fine to run the database from a regular (separate) container instead of the all-in-one setup, which is a bit nicer anyways in my opinion. version: '3'
services:
app:
depends_on:
- db
build:
context: .
dockerfile: packaging/Dockerfile
ports:
- "5173:5173"
environment:
- TRANSCRIBEE_BACKEND_DATABASE_URL=postgresql://transcribee:transcribee@db:5432/transcribee
volumes:
- storage_data:/app/backend/storage
- pages_data:/app/backend/data/pages
- models:/app/worker/transcribee_worker/.data/models
db:
image: postgres:14
environment:
POSTGRES_USER: transcribee
POSTGRES_PASSWORD: transcribee
POSTGRES_DB: transcribee
volumes:
- pg_data:/var/lib/postgresql/data
volumes:
pg_data:
storage_data:
pages_data:
models: In addition:
Works without problems for a simple local setup. |
I have made the same adjustments as @JonasGruenwald. thank you for that! I use an M2 Macbook, macOS 14.5, Docker 4.27.1 (136059) compose.yml:
packaging/Procfile:
packaging/setup_backend.sh:
Error:
|
Great project! I have trying to debug this error but I am a bit over my head. Seems that there is an issue with postgresql. Would you have any pointers?
System: Macbook Pro M1
OS: Ventura 13.2
Install types: Nix, Docker
Error:
transcribee % docker run -it -p 5173:5173 transcribee:latest
system | Tmux socket name: overmind-packaging-BdSLmHHcgziSY4alAQrhK
system | Tmux session ID: packaging
system | Listening at ./.overmind.sock
db | Started with pid 75...
worker | Started with pid 66...
backend | Started with pid 64...
db | initdb: error: cannot be run as root
db | Please log in (using, e.g., "su") as the (unprivileged) user that will
db | own the server process.
backend | + echo -e '\033[1m# setting up backend:\033[0m\n'
backend | # setting up backend:
backend |
db | mkdir: cannot create directory '../backend/db/sockets': No such file or directory
backend | + pdm run -p ../backend/ migrate
frontend | Started with pid 71...
db | pg_ctl: cannot be run as root
db | Please log in (using, e.g., "su") as the (unprivileged) user that will
db | own the server process.
db | createdb: error: connection to server on socket "/app/packaging/../backend/db/sockets//.s.PGSQL.5432" failed: No such file or directory
db | Is the server running locally and accepting connections on that socket?
frontend |
frontend | > [email protected] dev /app/frontend
frontend | > vite "--clearScreen" "false"
frontend |
worker | INFO:root:Reload enabled
frontend | [plugin:favicon-plugin] context method emitFile() is not supported in serve mode. This plugin is likely not vite-compatible.
frontend | [plugin:favicon-plugin] context method emitFile() is not supported in serve mode. This plugin is likely not vite-compatible.
frontend | [plugin:favicon-plugin] context method emitFile() is not supported in serve mode. This plugin is likely not vite-compatible.
frontend | [plugin:favicon-plugin] context method emitFile() is not supported in serve mode. This plugin is likely not vite-compatible.
frontend | [plugin:favicon-plugin] context method emitFile() is not supported in serve mode. This plugin is likely not vite-compatible.
frontend |
frontend | VITE v4.5.0 ready in 436 ms
frontend |
frontend | ➜ Local: http://localhost:5173/
frontend | ➜ Network: http://172.17.0.2:5173/
frontend | ➜ press h to show help
worker | INFO:watchfiles.main:120 changes detected
worker | INFO:root:Source code change detected, reloading worker
backend | Traceback (most recent call last):
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
backend | return fn()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 320, in connect
backend | return _ConnectionFairy._checkout(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 884, in _checkout
backend | fairy = _ConnectionRecord.checkout(pool)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 486, in checkout
backend | rec = pool._do_get()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 256, in _do_get
backend | return self._create_connection()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
backend | return _ConnectionRecord(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 381, in init
backend | self.__connect()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 677, in connect
backend | with util.safe_reraise():
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
backend | compat.raise(
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise
backend | raise exception
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 673, in __connect
backend | self.dbapi_connection = connection = pool._invoke_creator(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 578, in connect
backend | return dialect.connect(*cargs, **cparams)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 598, in connect
backend | return self.dbapi.connect(*cargs, **cparams)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect
backend | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
backend | psycopg2.OperationalError: connection to server on socket "/app/backend/db/sockets/.s.PGSQL.5432" failed: No such file or directory
backend | Is the server running locally and accepting connections on that socket?
backend |
backend |
backend | The above exception was the direct cause of the following exception:
backend |
backend | Traceback (most recent call last):
backend | File "/app/backend/.venv/bin/alembic", line 8, in
backend | sys.exit(main())
backend | File "/app/backend/.venv/lib/python3.10/site-packages/alembic/config.py", line 630, in main
backend | CommandLine(prog=prog).main(argv=argv)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/alembic/config.py", line 624, in main
backend | self.run_cmd(cfg, options)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/alembic/config.py", line 601, in run_cmd
backend | fn(
backend | File "/app/backend/.venv/lib/python3.10/site-packages/alembic/command.py", line 398, in upgrade
backend | script.run_env()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 579, in run_env
backend | util.load_python_file(self.dir, "env.py")
backend | File "/app/backend/.venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
backend | module = load_module_py(module_id, path)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 109, in load_module_py
backend | spec.loader.exec_module(module) # type: ignore
backend | File "", line 883, in exec_module
backend | File "", line 241, in _call_with_frames_removed
backend | File "/app/backend/transcribee_backend/db/migrations/env.py", line 95, in
backend | run_migrations_online()
backend | File "/app/backend/transcribee_backend/db/migrations/env.py", line 83, in run_migrations_online
backend | with connectable.connect() as connection:
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3315, in connect
backend | return self._connection_cls(self, close_with_result=close_with_result)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 96, in init
backend | else engine.raw_connection()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3394, in raw_connection
backend | return self._wrap_pool_connect(self.pool.connect, _connection)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3364, in _wrap_pool_connect
backend | Connection.handle_dbapi_exception_noconnection(
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2198, in handle_dbapi_exception_noconnection
backend | util.raise(
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise
backend | raise exception
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
backend | return fn()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 320, in connect
backend | return _ConnectionFairy._checkout(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 884, in _checkout
backend | fairy = _ConnectionRecord.checkout(pool)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 486, in checkout
backend | rec = pool._do_get()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 256, in _do_get
backend | return self._create_connection()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
backend | return _ConnectionRecord(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 381, in init
backend | self.__connect()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 677, in connect
backend | with util.safe_reraise():
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
backend | compat.raise(
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise
backend | raise exception
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 673, in __connect
backend | self.dbapi_connection = connection = pool._invoke_creator(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 578, in connect
backend | return dialect.connect(*cargs, **cparams)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 598, in connect
backend | return self.dbapi.connect(*cargs, **cparams)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect
backend | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
backend | sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server on socket "/app/backend/db/sockets/.s.PGSQL.5432" failed: No such file or directory
backend | Is the server running locally and accepting connections on that socket?
backend |
backend | (Background on this error at: https://sqlalche.me/e/14/e3q8)
worker | INFO:watchfiles.main:19 changes detected
worker | INFO:root:Source code change detected, reloading worker
worker | Process Process-2:
worker | Traceback (most recent call last):
worker | File "/nix/store/lmybmvqcqqli4bg3wwbjdp0a5pfvhpam-python3-3.10.10/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
worker | self.run()
worker | File "/nix/store/lmybmvqcqqli4bg3wwbjdp0a5pfvhpam-python3-3.10.10/lib/python3.10/multiprocessing/process.py", line 108, in run
worker | self._target(*self._args, **self._kwargs)
worker | File "/app/worker/run.py", line 100, in run_sync
worker | asyncio.run(run(args))
worker | File "/nix/store/lmybmvqcqqli4bg3wwbjdp0a5pfvhpam-python3-3.10.10/lib/python3.10/asyncio/runners.py", line 44, in run
worker | return loop.run_until_complete(main)
worker | File "/nix/store/lmybmvqcqqli4bg3wwbjdp0a5pfvhpam-python3-3.10.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
worker | return future.result()
worker | File "/app/worker/run.py", line 112, in run
worker | from transcribee_worker.worker import Worker # noqa
worker | File "/app/worker/transcribee_worker/worker.py", line 27, in
worker | from transcribee_worker.identify_speakers import identify_speakers
worker | File "/app/worker/transcribee_worker/identify_speakers.py", line 6, in
worker | import torch
worker | File "/app/worker/.venv/lib/python3.10/site-packages/torch/init.py", line 933, in
worker | from ._tensor import Tensor
worker | File "/app/worker/.venv/lib/python3.10/site-packages/torch/_tensor.py", line 21, in
worker | from torch.overrides import (
worker | File "/app/worker/run.py", line 86, in handle_signal
worker | os.kill(p.pid, sig)
worker | ProcessLookupError: [Errno 3] No such process
backend | INFO: Will watch for changes in these directories: ['/app/backend']
backend | INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
backend | INFO: Started reloader process [198] using WatchFiles
backend | INFO: Started server process [203]
backend | INFO: Waiting for application startup.
backend | INFO: Application startup complete.
backend | ERROR:root:Repeating task failed
backend | Traceback (most recent call last):
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
backend | return fn()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 320, in connect
backend | return _ConnectionFairy._checkout(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 884, in _checkout
backend | fairy = _ConnectionRecord.checkout(pool)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 486, in checkout
backend | rec = pool.do_get()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 145, in do_get
backend | with util.safe_reraise():
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
backend | compat.raise(
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise
backend | raise exception
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 143, in _do_get
backend | return self._create_connection()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
backend | return _ConnectionRecord(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 381, in init
backend | self.__connect()
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 677, in connect
backend | with util.safe_reraise():
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
backend | compat.raise(
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise
backend | raise exception
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 673, in __connect
backend | self.dbapi_connection = connection = pool._invoke_creator(self)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 578, in connect
backend | return dialect.connect(*cargs, **cparams)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 598, in connect
backend | return self.dbapi.connect(*cargs, **cparams)
backend | File "/app/backend/.venv/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect
backend | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
backend | psycopg2.OperationalError: connection to server on socket "/app/backend/db/sockets/.s.PGSQL.5432" failed: No such file or directory
backend | Is the server running locally and accepting connections on that socket?
The text was updated successfully, but these errors were encountered: