ion
ion copied to clipboard
Issue trying to set up a dev environment
trafficstars
Steps to reproduce
- Trying to build and launch the docker part (gap in how to set up the dev environment in the SETUP.md).
Expected behavior
Database, server and interface up
Actual behavior
Database container :
LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Container intranet output :
django.db.utils.OperationalError: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
Did your docker-compose up work correctly? What's the output of the command if you run it without -d?
No it didn't work for the intranet container, looping on this issue mentioned earlier.
[+] Running 7/7
- Network docker_intranet_net Created 0.0s
- Volume "docker_pgdata" Created 0.0s
- Container database Created 0.1s
- Container server Created 0.1s
- Container intranet Created 0.1s
- Container celerybeat Created 0.1s
- Container celery Created 0.1s
Attaching to celery, celerybeat, database, intranet, server
server | 1:C 08 Oct 2022 12:53:18.200 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
server | 1:C 08 Oct 2022 12:53:18.200 # Redis version=7.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
server | 1:C 08 Oct 2022 12:53:18.200 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
server | 1:M 08 Oct 2022 12:53:18.200 * monotonic clock: POSIX clock_gettime
server | 1:M 08 Oct 2022 12:53:18.202 * Running mode=standalone, port=6379.
server | 1:M 08 Oct 2022 12:53:18.202 # Server initialized
server | 1:M 08 Oct 2022 12:53:18.202 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
server | 1:M 08 Oct 2022 12:53:18.202 * Ready to accept connections
database | The files belonging to this database system will be owned by user "postgres".
database | This user must also own the server process.
database |
database | The database cluster will be initialized with locale "en_US.utf8".
database | The default database encoding has accordingly been set to "UTF8".
database | The default text search configuration will be set to "english".
database |
database | Data page checksums are disabled.
database |
database | fixing permissions on existing directory /var/lib/postgresql/data ... ok
database | creating subdirectories ... ok
database | selecting dynamic shared memory implementation ... posix
database | selecting default max_connections ... 100
database | selecting default shared_buffers ... 128MB
database | selecting default time zone ... Etc/UTC
database | creating configuration files ... ok
database | running bootstrap script ... ok
intranet | ---- Running initial setup tasks -----
intranet | This may take a while.
intranet | Allowing execution of scripts...
intranet |
intranet |
intranet | Running initial setup script...
database | performing post-bootstrap initialization ... ok
database | syncing data to disk ... initdb: warning: enabling "trust" authentication for local connections
database | You can change this by editing pg_hba.conf or using the option -A, or
database | --auth-local and --auth-host, the next time you run initdb.
database | ok
database |
database |
database | Success. You can now start the database server using:
database |
database | pg_ctl -D /var/lib/postgresql/data -l logfile start
database |
database | waiting for server to start....2022-10-08 12:53:19.413 UTC [48] LOG: starting PostgreSQL 14.5 (Debian 14.5-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
database | 2022-10-08 12:53:19.415 UTC [48] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
database | 2022-10-08 12:53:19.424 UTC [49] LOG: database system was shut down at 2022-10-08 12:53:19 UTC
database | 2022-10-08 12:53:19.428 UTC [48] LOG: database system is ready to accept connections
database | done
database | server started
database | CREATE DATABASE
database |
database |
database | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
database |
database | 2022-10-08 12:53:19.691 UTC [48] LOG: received fast shutdown request
database | waiting for server to shut down....2022-10-08 12:53:19.692 UTC [48] LOG: aborting any active transactions
database | 2022-10-08 12:53:19.694 UTC [48] LOG: background worker "logical replication launcher" (PID 55) exited with exit code 1
database | 2022-10-08 12:53:19.694 UTC [50] LOG: shutting down
database | 2022-10-08 12:53:19.709 UTC [48] LOG: database system is shut down
database | done
database | server stopped
database |
database | PostgreSQL init process complete; ready for start up.
database |
database | 2022-10-08 12:53:19.815 UTC [1] LOG: starting PostgreSQL 14.5 (Debian 14.5-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
database | 2022-10-08 12:53:19.815 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
database | 2022-10-08 12:53:19.815 UTC [1] LOG: listening on IPv6 address "::", port 5432
database | 2022-10-08 12:53:19.819 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
database | 2022-10-08 12:53:19.825 UTC [62] LOG: database system was shut down at 2022-10-08 12:53:19 UTC
database | 2022-10-08 12:53:19.829 UTC [1] LOG: database system is ready to accept connections
celerybeat | Warning: the environment variable LANG is not set!
celerybeat | We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
celery | Warning: the environment variable LANG is not set!
celery | We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
celery | Creating a virtualenv for this project...
celery | Pipfile: /ion/Pipfile
celerybeat | Creating a virtualenv for this project...
celerybeat | Pipfile: /ion/Pipfile
celery | Using /usr/bin/python3 (3.10.5) to create virtualenv...
celerybeat | Using /usr/bin/python3 (3.10.5) to create virtualenv...
⠸ Creating virtual environment...created virtual environment CPython3.10.5.final.0-64 in 874ms
celery | creator Venv(dest=/root/.local/share/virtualenvs/ion-elek-MwJ, clear=False, no_vcs_ignore=False, global=False, describe=CPython3Posix)
celery | seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
celery | added seed packages: pip==22.2.2, setuptools==65.3.0, wheel==0.37.1
celery | activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
celery |
celery |✔ Successfully created virtual environment!
⠼ Creating virtual environment...created virtual environment CPython3.10.5.final.0-64 in 896ms
celerybeat | creator Venv(dest=/root/.local/share/virtualenvs/ion-elek-MwJ, clear=False, no_vcs_ignore=False, global=False, describe=CPython3Posix)
celerybeat | seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
celerybeat | added seed packages: pip==22.2.2, setuptools==65.3.0, wheel==0.37.1
celerybeat | activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
celerybeat |
celerybeat |✔ Successfully created virtual environment!
celery | Virtualenv location: /root/.local/share/virtualenvs/ion-elek-MwJ
celerybeat | Virtualenv location: /root/.local/share/virtualenvs/ion-elek-MwJ
intranet | Traceback (most recent call last):
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
intranet | self.connect()
intranet | File "/usr/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
intranet | return func(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/base/base.py", line 200, in connect
intranet | self.connection = self.get_new_connection(conn_params)
intranet | File "/usr/lib/python3.10/site-packages/django_prometheus/db/common.py", line 45, in get_new_connection
intranet | return super().get_new_connection(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
intranet | return func(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
intranet | connection = Database.connect(**conn_params)
intranet | File "/usr/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
intranet | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
intranet | psycopg2.OperationalError: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
intranet | Is the server running locally and accepting connections on that socket?
intranet |
intranet |
intranet | The above exception was the direct cause of the following exception:
intranet |
intranet | Traceback (most recent call last):
intranet | File "/ion/create-users.py", line 87, in <module>
intranet | create_admins()
intranet | File "/ion/create-users.py", line 68, in create_admins
intranet | user = User.objects.get_or_create(username=name)[0]
intranet | File "/usr/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
intranet | return getattr(self.get_queryset(), name)(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/db/models/query.py", line 581, in get_or_create
intranet | return self.get(**kwargs), False
intranet | File "/usr/lib/python3.10/site-packages/cacheops/query.py", line 353, in get
intranet | return qs._no_monkey.get(qs, *args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/db/models/query.py", line 431, in get
intranet | num = len(clone)
intranet | File "/usr/lib/python3.10/site-packages/django/db/models/query.py", line 262, in __len__
intranet | self._fetch_all()
intranet | File "/usr/lib/python3.10/site-packages/cacheops/query.py", line 273, in _fetch_all
intranet | return self._no_monkey._fetch_all(self)
intranet | File "/usr/lib/python3.10/site-packages/django/db/models/query.py", line 1324, in _fetch_all
intranet | self._result_cache = list(self._iterable_class(self))
intranet | File "/usr/lib/python3.10/site-packages/django/db/models/query.py", line 51, in __iter__
intranet | results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
intranet | File "/usr/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1173, in execute_sql
intranet | cursor = self.connection.cursor()
intranet | File "/usr/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
intranet | return func(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/base/base.py", line 259, in cursor
intranet | return self._cursor()
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/base/base.py", line 235, in _cursor
intranet | self.ensure_connection()
intranet | File "/usr/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
intranet | return func(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/base/base.py", line 218, in ensure_connection
intranet | with self.wrap_database_errors:
intranet | File "/usr/lib/python3.10/site-packages/django/db/utils.py", line 90, in __exit__
intranet | raise dj_exc_value.with_traceback(traceback) from exc_value
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
intranet | self.connect()
intranet | File "/usr/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
intranet | return func(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/base/base.py", line 200, in connect
intranet | self.connection = self.get_new_connection(conn_params)
intranet | File "/usr/lib/python3.10/site-packages/django_prometheus/db/common.py", line 45, in get_new_connection
intranet | return super().get_new_connection(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
intranet | return func(*args, **kwargs)
intranet | File "/usr/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
intranet | connection = Database.connect(**conn_params)
intranet | File "/usr/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
intranet | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
intranet | django.db.utils.OperationalError: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
intranet | Is the server running locally and accepting connections on that socket?
Looping on this error then fails to create this container.
No one ?
Thank you for the issue report; we are actively working on a fix.