singularityhub / sregistry

server for storage and management of singularity images
https://singularityhub.github.io/sregistry
Mozilla Public License 2.0
103 stars 42 forks source link

cannot start with docker compose #428

Open coconutLatte opened 1 year ago

coconutLatte commented 1 year ago

os version

ubuntu:22.04

sregistry version

2.1.0

After docker-compose up -d

root@singularity-hub:~/workspace/sregistry# docker ps
CONTAINER ID   IMAGE                                      COMMAND                  CREATED              STATUS                           PORTS                                        NAMES
47299c1d068f   quay.io/vanessa/sregistry_nginx            "nginx -g 'daemon of…"   About a minute ago   Up About a minute                0.0.0.0:80->80/tcp, :::80->80/tcp, 443/tcp   sregistry_nginx_1
753629226ba8   quay.io/vanessa/sregistry                  "/bin/sh -c /code/ru…"   About a minute ago   Restarting (127) 9 seconds ago                                                sregistry_uwsgi_1
cbd5198d1870   redis:latest                               "docker-entrypoint.s…"   About a minute ago   Up About a minute                6379/tcp                                     sregistry_redis_1
175ed062becb   minio/minio:RELEASE.2022-08-02T23-59-16Z   "/usr/bin/docker-ent…"   About a minute ago   Up About a minute                0.0.0.0:9000->9000/tcp, :::9000->9000/tcp    sregistry_minio_1
27998e6726d6   postgres                                   "docker-entrypoint.s…"   About a minute ago   Up About a minute                5432/tcp                                     sregistry_db_1

the sregistry_uwsgi_1 container continues to restart. logs are below

db_1         | ********************************************************************************
db_1         | WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will allow
db_1         |          anyone with access to the Postgres port to access your database without
db_1         |          a password, even if POSTGRES_PASSWORD is set. See PostgreSQL
db_1         |          documentation about "trust":
db_1         |          https://www.postgresql.org/docs/current/auth-trust.html
db_1         |          In Docker's default configuration, this is effectively any other
db_1         |          container on the same system.
db_1         | 
db_1         |          It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust. Replace
db_1         |          it with "-e POSTGRES_PASSWORD=password" instead to set a password in
db_1         |          "docker run".
db_1         | ********************************************************************************
db_1         | The files belonging to this database system will be owned by user "postgres".
db_1         | This user must also own the server process.
db_1         | 
db_1         | The database cluster will be initialized with locale "en_US.utf8".
db_1         | The default database encoding has accordingly been set to "UTF8".
db_1         | The default text search configuration will be set to "english".
db_1         | 
db_1         | Data page checksums are disabled.
db_1         | 
db_1         | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1         | creating subdirectories ... ok
db_1         | selecting dynamic shared memory implementation ... posix
db_1         | selecting default max_connections ... 100
db_1         | selecting default shared_buffers ... 128MB
db_1         | selecting default time zone ... Etc/UTC
db_1         | creating configuration files ... ok
db_1         | running bootstrap script ... ok
db_1         | performing post-bootstrap initialization ... ok
db_1         | initdb: warning: enabling "trust" authentication for local connections
db_1         | initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
db_1         | syncing data to disk ... ok
db_1         | 
db_1         | 
db_1         | Success. You can now start the database server using:
db_1         | 
db_1         |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1         | 
db_1         | waiting for server to start.....2023-05-09 11:19:47.319 UTC [47] LOG:  starting PostgreSQL 15.2 (Debian 15.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
db_1         | .2023-05-09 11:19:47.752 UTC [47] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1         | 2023-05-09 11:19:48.058 UTC [50] LOG:  database system was shut down at 2023-05-09 11:19:41 UTC
db_1         | 2023-05-09 11:19:48.199 UTC [47] LOG:  database system is ready to accept connections
db_1         |  done
db_1         | server started
db_1         | 
db_1         | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_1         | 
db_1         | 2023-05-09 11:19:48.308 UTC [47] LOG:  received fast shutdown request
db_1         | waiting for server to shut down....2023-05-09 11:19:48.713 UTC [47] LOG:  aborting any active transactions
db_1         | 2023-05-09 11:19:48.759 UTC [47] LOG:  background worker "logical replication launcher" (PID 53) exited with exit code 1
db_1         | 2023-05-09 11:19:48.759 UTC [48] LOG:  shutting down
db_1         | 2023-05-09 11:19:49.285 UTC [48] LOG:  checkpoint starting: shutdown immediate
db_1         | ..2023-05-09 11:19:50.745 UTC [48] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.606 s, sync=0.283 s, total=1.986 s; sync files=2, longest=0.219 s, average=0.142 s; distance=0 kB, estimate=0 kB
db_1         | 2023-05-09 11:19:50.749 UTC [47] LOG:  database system is shut down
db_1         |  done
db_1         | server stopped
db_1         | 
db_1         | PostgreSQL init process complete; ready for start up.
db_1         | 
db_1         | 2023-05-09 11:19:54.005 UTC [1] LOG:  starting PostgreSQL 15.2 (Debian 15.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
db_1         | 2023-05-09 11:19:54.006 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1         | 2023-05-09 11:19:54.006 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1         | 2023-05-09 11:19:57.320 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1         | 2023-05-09 11:19:57.993 UTC [61] LOG:  database system was shut down at 2023-05-09 11:19:50 UTC
db_1         | 2023-05-09 11:19:58.063 UTC [1] LOG:  database system is ready to accept connections
minio_1      | WARNING: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables
minio_1      | MinIO Object Storage Server
minio_1      | Copyright: 2015-2022 MinIO, Inc.
minio_1      | License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
minio_1      | Version: RELEASE.2022-08-02T23-59-16Z (go1.18.5 linux/amd64)
minio_1      | 
minio_1      | Status:         1 Online, 0 Offline. 
minio_1      | API: http://172.22.0.2:9000  http://127.0.0.1:9000 
minio_1      | Console: http://172.22.0.2:41983 http://127.0.0.1:41983 
minio_1      | 
minio_1      | Documentation: https://docs.min.io
minio_1      | 
minio_1      |  You are running an older version of MinIO released 9 months ago 
minio_1      |  Update: Run `mc admin update` 
minio_1      | 
minio_1      | 
redis_1      | 1:C 09 May 2023 11:19:40.359 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1      | 1:C 09 May 2023 11:19:40.359 # Redis version=7.0.11, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1      | 1:C 09 May 2023 11:19:40.359 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1      | 1:M 09 May 2023 11:19:40.360 * monotonic clock: POSIX clock_gettime
redis_1      | 1:M 09 May 2023 11:19:40.363 * Running mode=standalone, port=6379.
redis_1      | 1:M 09 May 2023 11:19:40.363 # Server initialized
redis_1      | 1:M 09 May 2023 11:19:40.364 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. 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.
redis_1      | 1:M 09 May 2023 11:19:40.365 * Ready to accept connections
scheduler_1  | Traceback (most recent call last):
scheduler_1  |   File "/code/manage.py", line 9, in <module>
scheduler_1  |     execute_from_command_line(sys.argv)
scheduler_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
scheduler_1  |     utility.execute()
scheduler_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 357, in execute
scheduler_1  |     django.setup()
scheduler_1  |   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
scheduler_1  |     apps.populate(settings.INSTALLED_APPS)
scheduler_1  |   File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
scheduler_1  |     app_config.import_models()
scheduler_1  |   File "/usr/local/lib/python3.9/site-packages/django/apps/config.py", line 211, in import_models
scheduler_1  |     self.models_module = import_module(models_module_name)
scheduler_1  |   File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
scheduler_1  |     return _bootstrap._gcd_import(name[level:], package, level)
scheduler_1  |   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
scheduler_1  |   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
scheduler_1  |   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
scheduler_1  |   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
scheduler_1  |   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
scheduler_1  |   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
scheduler_1  |   File "/code/shub/apps/logs/models.py", line 51, in <module>
scheduler_1  |     class APIRequestCount(models.Model):
scheduler_1  |   File "/code/shub/apps/logs/models.py", line 56, in APIRequestCount
scheduler_1  |     from shub.apps.main.models import Collection
scheduler_1  |   File "/code/shub/apps/main/models/__init__.py", line 1, in <module>
scheduler_1  |     from .containers import Container
scheduler_1  |   File "/code/shub/apps/main/models/containers.py", line 40, in <module>
scheduler_1  |     class Container(models.Model):
scheduler_1  |   File "/code/shub/apps/main/models/containers.py", line 58, in Container
scheduler_1  |     metadata = models.JSONField(default=dict, blank=True)
scheduler_1  | AttributeError: module 'django.db.models' has no attribute 'JSONField'
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
uwsgi_1      | /bin/sh: 1: /code/run_uwsgi.sh: not found
worker_1     | Traceback (most recent call last):
worker_1     |   File "/code/manage.py", line 9, in <module>
worker_1     |     execute_from_command_line(sys.argv)
worker_1     |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
worker_1     |     utility.execute()
worker_1     |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 357, in execute
worker_1     |     django.setup()
worker_1     |   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
worker_1     |     apps.populate(settings.INSTALLED_APPS)
worker_1     |   File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
worker_1     |     app_config.import_models()
worker_1     |   File "/usr/local/lib/python3.9/site-packages/django/apps/config.py", line 211, in import_models
worker_1     |     self.models_module = import_module(models_module_name)
worker_1     |   File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
worker_1     |     return _bootstrap._gcd_import(name[level:], package, level)
worker_1     |   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
worker_1     |   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
worker_1     |   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
worker_1     |   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
worker_1     |   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
worker_1     |   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
worker_1     |   File "/code/shub/apps/logs/models.py", line 51, in <module>
worker_1     |     class APIRequestCount(models.Model):
worker_1     |   File "/code/shub/apps/logs/models.py", line 56, in APIRequestCount
worker_1     |     from shub.apps.main.models import Collection
worker_1     |   File "/code/shub/apps/main/models/__init__.py", line 1, in <module>
worker_1     |     from .containers import Container
worker_1     |   File "/code/shub/apps/main/models/containers.py", line 40, in <module>
worker_1     |     class Container(models.Model):
worker_1     |   File "/code/shub/apps/main/models/containers.py", line 58, in Container
worker_1     |     metadata = models.JSONField(default=dict, blank=True)
worker_1     | AttributeError: module 'django.db.models' has no attribute 'JSONField'

It seems uwsgi_1 container not running as expect.

How can I fix it or debug it? Hope for some help.

vsoch commented 1 year ago

I think you likely updated your containers without updating your code, or vice versa. Try cloning fresh, building fresh, and then starting again.