pulp / pulpcore

Pulp 3 pulpcore package https://pypi.org/project/pulpcore/
GNU General Public License v2.0
308 stars 116 forks source link

Multiple Errors using docker #5790

Closed urzparat closed 2 months ago

urzparat commented 2 months ago

Version I tried to get started with pulp with docker:

Describe the bug When I try to use pulp with the following command:

docker run --detach --publish 8080:80 --name pulp --volume "$(pwd)/settings":/etc/pulp --volume "$(pwd)/pulp_storage":/var/lib/pulp --volume "$(pwd)/pgsql":/var/lib/pgsql --volume "$(pwd)/containers":/var/lib/containers --device /dev/fuse pulp/pulp

I can't reset the password (pulpcore-manager reset-admin-password), because of the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.9/site-packages/psycopg/cursor.py", line 97, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
                                                             ^

So I tried it with the docker compose way (with /pulp-oci-images/images/compose/compose.yml) and getting even more errors:

Errors

    redis-1                      | 1:C 12 Sep 2024 06:16:15.118 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it 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:C 12 Sep 2024 06:16:15.118 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
    redis-1                      | 1:C 12 Sep 2024 06:16:15.118 * Redis version=7.4.0, bits=64, commit=00000000, modified=0, pid=1, just started
    redis-1                      | 1:C 12 Sep 2024 06:16:15.118 # 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 12 Sep 2024 06:16:15.118 * monotonic clock: POSIX clock_gettime
    redis-1                      | 1:M 12 Sep 2024 06:16:15.118 * Running mode=standalone, port=6379.
    redis-1                      | 1:M 12 Sep 2024 06:16:15.119 * Server initialized
    redis-1                      | 1:M 12 Sep 2024 06:16:15.119 * Loading RDB produced by version 7.4.0
    redis-1                      | 1:M 12 Sep 2024 06:16:15.119 * RDB age 4861 seconds
    redis-1                      | 1:M 12 Sep 2024 06:16:15.119 * RDB memory usage when created 0.93 Mb
    redis-1                      | 1:M 12 Sep 2024 06:16:15.119 * Done loading RDB, keys loaded: 0, keys expired: 0.
    redis-1                      | 1:M 12 Sep 2024 06:16:15.119 * DB loaded from disk: 0.000 seconds
    redis-1                      | 1:M 12 Sep 2024 06:16:15.119 * Ready to accept connections tcp
    postgres-1                   | 
    postgres-1                   | PostgreSQL Database directory appears to contain a database; Skipping initialization
    postgres-1                   | 
    postgres-1                   | 2024-09-12 06:16:15.152 UTC [1] LOG:  starting PostgreSQL 13.16 (Debian 13.16-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
    postgres-1                   | 2024-09-12 06:16:15.152 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
    postgres-1                   | 2024-09-12 06:16:15.152 UTC [1] LOG:  listening on IPv6 address "::", port 5432
    postgres-1                   | 2024-09-12 06:16:15.153 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
    postgres-1                   | 2024-09-12 06:16:15.157 UTC [28] LOG:  database system was shut down at 2024-09-12 04:55:14 UTC
    postgres-1                   | 2024-09-12 06:16:15.161 UTC [1] LOG:  database system is ready to accept connections
    set_init_password_service-1  | Waiting on postgresql to start...
    set_init_password_service-1  | Postgres started.
    set_init_password_service-1  | Checking for database migrations
    set_init_password_service-1  | Database migrated!
    migration_service-1          | Operations to perform:
    migration_service-1          |   Apply all migrations: ansible, auth, certguard, container, contenttypes, core, deb, file, maven, ostree, python, rpm, sessions
    migration_service-1          | Running migrations:
    migration_service-1          |   No migrations to apply.
    migration_service-1 exited with code 0
    signing_key_service-1        | Waiting on postgresql to start...
    signing_key_service-1        | Postgres started.
    pulp_content-1               | Waiting on postgresql to start...
    pulp_content-1               | Traceback (most recent call last):
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 89, in _lock_storage
    pulp_content-1               |     asyncio.get_running_loop()
    pulp_content-1               | RuntimeError: no running event loop
    pulp_content-1               | 
    pulp_content-1               | During handling of the above exception, another exception occurred:
    pulp_content-1               | 
    pulp_content-1               | Traceback (most recent call last):
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 58, in __getitem__
    pulp_content-1               |     return getattr(self._connections, alias)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 118, in __getattr__
    pulp_content-1               |     return getattr(storage, key)
    pulp_content-1               | AttributeError: '_thread._local' object has no attribute 'default'
    pulp_content-1               | 
    pulp_content-1               | During handling of the above exception, another exception occurred:
    pulp_content-1               | 
    pulp_content-1               | Traceback (most recent call last):
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in 
    pulp_content-1               |     with open(DB_ENCRYPTION_KEY, "rb") as key_file:
    pulp_content-1               | PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_content-1               | 
    pulp_content-1               | During handling of the above exception, another exception occurred:
    pulp_content-1               | 
    pulp_content-1               | Traceback (most recent call last):
    pulp_content-1               |   File "/usr/bin/wait_on_postgres.py", line 12, in 
    pulp_content-1               |     connection.ensure_connection()
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
    pulp_content-1               |     return getattr(self._connections[self._alias], item)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 60, in __getitem__
    pulp_content-1               |     if alias not in self.settings:
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    pulp_content-1               |     res = instance.__dict__[self.name] = self.func(instance)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 45, in settings
    pulp_content-1               |     self._settings = self.configure_settings(self._settings)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 148, in configure_settings
    pulp_content-1               |     databases = super().configure_settings(databases)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 50, in configure_settings
    pulp_content-1               |     settings = getattr(django_settings, self.settings_name)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 102, in __getattr__
    pulp_content-1               |     self._setup(name)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 89, in _setup
    pulp_content-1               |     self._wrapped = Settings(settings_module)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 217, in __init__
    pulp_content-1               |     mod = importlib.import_module(self.SETTINGS_MODULE)
    pulp_content-1               |   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    pulp_content-1               |     return _bootstrap._gcd_import(name[level:], package, level)
    pulp_content-1               |   File "", line 1030, in _gcd_import
    pulp_content-1               |   File "", line 1007, in _find_and_load
    pulp_content-1               |   File "", line 986, in _find_and_load_unlocked
    pulp_content-1               |   File "", line 680, in _load_unlocked
    pulp_content-1               |   File "", line 850, in exec_module
    pulp_content-1               |   File "", line 228, in _call_with_frames_removed
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 477, in 
    pulp_content-1               |     raise ImproperlyConfigured(
    pulp_content-1               | django.core.exceptions.ImproperlyConfigured: Could not load DB_ENCRYPTION_KEY file '/etc/pulp/certs/database_fields.symmetric.key': [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    signing_key_service-1        | Checking for database migrations
    pulp_worker-1                | Traceback (most recent call last):
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 89, in _lock_storage
    pulp_worker-1                |     asyncio.get_running_loop()
    pulp_worker-1                | RuntimeError: no running event loop
    pulp_worker-1                | 
    pulp_worker-1                | During handling of the above exception, another exception occurred:
    pulp_worker-1                | 
    pulp_worker-1                | Traceback (most recent call last):
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 58, in __getitem__
    pulp_worker-1                | Waiting on postgresql to start...
    pulp_worker-1                |     return getattr(self._connections, alias)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 118, in __getattr__
    pulp_worker-1                |     return getattr(storage, key)
    pulp_worker-1                | AttributeError: '_thread._local' object has no attribute 'default'
    pulp_worker-1                | 
    pulp_worker-1                | During handling of the above exception, another exception occurred:
    pulp_worker-1                | 
    pulp_worker-1                | Traceback (most recent call last):
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in 
    pulp_worker-1                |     with open(DB_ENCRYPTION_KEY, "rb") as key_file:
    pulp_worker-1                | PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_worker-1                | 
    pulp_worker-1                | During handling of the above exception, another exception occurred:
    pulp_worker-1                | 
    pulp_worker-1                | Traceback (most recent call last):
    pulp_worker-1                |   File "/usr/bin/wait_on_postgres.py", line 12, in 
    pulp_worker-1                |     connection.ensure_connection()
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
    pulp_worker-1                |     return getattr(self._connections[self._alias], item)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 60, in __getitem__
    pulp_worker-1                |     if alias not in self.settings:
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    pulp_worker-1                |     res = instance.__dict__[self.name] = self.func(instance)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 45, in settings
    pulp_worker-1                |     self._settings = self.configure_settings(self._settings)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 148, in configure_settings
    pulp_worker-1                |     databases = super().configure_settings(databases)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 50, in configure_settings
    pulp_worker-1                |     settings = getattr(django_settings, self.settings_name)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 102, in __getattr__
    pulp_worker-1                |     self._setup(name)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 89, in _setup
    pulp_worker-1                |     self._wrapped = Settings(settings_module)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 217, in __init__
    pulp_worker-1                |     mod = importlib.import_module(self.SETTINGS_MODULE)
    pulp_worker-1                |   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    pulp_worker-1                |     return _bootstrap._gcd_import(name[level:], package, level)
    pulp_worker-1                |   File "", line 1030, in _gcd_import
    pulp_worker-1                |   File "", line 1007, in _find_and_load
    pulp_worker-1                |   File "", line 986, in _find_and_load_unlocked
    pulp_worker-1                |   File "", line 680, in _load_unlocked
    pulp_worker-1                |   File "", line 850, in exec_module
    pulp_worker-1                |   File "", line 228, in _call_with_frames_removed
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 477, in 
    pulp_worker-1                |     raise ImproperlyConfigured(
    pulp_worker-1                | django.core.exceptions.ImproperlyConfigured: Could not load DB_ENCRYPTION_KEY file '/etc/pulp/certs/database_fields.symmetric.key': [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_worker-2                | Waiting on postgresql to start...
    pulp_worker-2                | Traceback (most recent call last):
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 89, in _lock_storage
    pulp_worker-2                |     asyncio.get_running_loop()
    pulp_worker-2                | RuntimeError: no running event loop
    pulp_worker-2                | 
    pulp_worker-2                | During handling of the above exception, another exception occurred:
    pulp_worker-2                | 
    pulp_worker-2                | Traceback (most recent call last):
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 58, in __getitem__
    pulp_worker-2                |     return getattr(self._connections, alias)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 118, in __getattr__
    pulp_worker-2                |     return getattr(storage, key)
    pulp_worker-2                | AttributeError: '_thread._local' object has no attribute 'default'
    pulp_worker-2                | 
    pulp_worker-2                | During handling of the above exception, another exception occurred:
    pulp_worker-2                | 
    pulp_worker-2                | Traceback (most recent call last):
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in 
    pulp_worker-2                |     with open(DB_ENCRYPTION_KEY, "rb") as key_file:
    pulp_worker-2                | PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_worker-2                | 
    pulp_worker-2                | During handling of the above exception, another exception occurred:
    pulp_worker-2                | 
    pulp_worker-2                | Traceback (most recent call last):
    pulp_worker-2                |   File "/usr/bin/wait_on_postgres.py", line 12, in 
    pulp_worker-2                |     connection.ensure_connection()
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
    pulp_worker-2                |     return getattr(self._connections[self._alias], item)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 60, in __getitem__
    pulp_worker-2                |     if alias not in self.settings:
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    pulp_worker-2                |     res = instance.__dict__[self.name] = self.func(instance)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 45, in settings
    pulp_worker-2                |     self._settings = self.configure_settings(self._settings)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 148, in configure_settings
    pulp_worker-2                |     databases = super().configure_settings(databases)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 50, in configure_settings
    pulp_worker-2                |     settings = getattr(django_settings, self.settings_name)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 102, in __getattr__
    pulp_worker-2                |     self._setup(name)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 89, in _setup
    pulp_worker-2                |     self._wrapped = Settings(settings_module)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 217, in __init__
    pulp_worker-2                |     mod = importlib.import_module(self.SETTINGS_MODULE)
    pulp_worker-2                |   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    pulp_worker-2                |     return _bootstrap._gcd_import(name[level:], package, level)
    pulp_worker-2                |   File "", line 1030, in _gcd_import
    pulp_worker-2                |   File "", line 1007, in _find_and_load
    pulp_worker-2                |   File "", line 986, in _find_and_load_unlocked
    pulp_worker-2                |   File "", line 680, in _load_unlocked
    pulp_worker-2                |   File "", line 850, in exec_module
    pulp_worker-2                |   File "", line 228, in _call_with_frames_removed
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 477, in 
    pulp_worker-2                |     raise ImproperlyConfigured(
    pulp_worker-2                | django.core.exceptions.ImproperlyConfigured: Could not load DB_ENCRYPTION_KEY file '/etc/pulp/certs/database_fields.symmetric.key': [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_content-2               | Traceback (most recent call last):
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 89, in _lock_storage
    pulp_content-2               | Waiting on postgresql to start...
    pulp_content-2               |     asyncio.get_running_loop()
    pulp_content-2               | RuntimeError: no running event loop
    pulp_content-2               | 
    pulp_content-2               | During handling of the above exception, another exception occurred:
    pulp_content-2               | 
    pulp_content-2               | Traceback (most recent call last):
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 58, in __getitem__
    pulp_content-2               |     return getattr(self._connections, alias)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 118, in __getattr__
    pulp_content-2               |     return getattr(storage, key)
    pulp_content-2               | AttributeError: '_thread._local' object has no attribute 'default'
    pulp_content-2               | 
    pulp_content-2               | During handling of the above exception, another exception occurred:
    pulp_content-2               | 
    pulp_content-2               | Traceback (most recent call last):
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in 
    pulp_content-2               |     with open(DB_ENCRYPTION_KEY, "rb") as key_file:
    pulp_content-2               | PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_content-2               | 
    pulp_content-2               | During handling of the above exception, another exception occurred:
    pulp_content-2               | 
    pulp_content-2               | Traceback (most recent call last):
    pulp_content-2               |   File "/usr/bin/wait_on_postgres.py", line 12, in 
    pulp_content-2               |     connection.ensure_connection()
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
    pulp_content-2               |     return getattr(self._connections[self._alias], item)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 60, in __getitem__
    pulp_content-2               |     if alias not in self.settings:
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    pulp_content-2               |     res = instance.__dict__[self.name] = self.func(instance)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 45, in settings
    pulp_content-2               |     self._settings = self.configure_settings(self._settings)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 148, in configure_settings
    pulp_content-2               |     databases = super().configure_settings(databases)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 50, in configure_settings
    pulp_content-2               |     settings = getattr(django_settings, self.settings_name)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 102, in __getattr__
    pulp_content-2               |     self._setup(name)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 89, in _setup
    pulp_content-2               |     self._wrapped = Settings(settings_module)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 217, in __init__
    pulp_content-2               |     mod = importlib.import_module(self.SETTINGS_MODULE)
    pulp_content-2               |   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    pulp_content-2               |     return _bootstrap._gcd_import(name[level:], package, level)
    pulp_content-2               |   File "", line 1030, in _gcd_import
    pulp_content-2               |   File "", line 1007, in _find_and_load
    pulp_content-2               |   File "", line 986, in _find_and_load_unlocked
    pulp_content-2               |   File "", line 680, in _load_unlocked
    pulp_content-2               |   File "", line 850, in exec_module
    pulp_content-2               |   File "", line 228, in _call_with_frames_removed
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 477, in 
    pulp_content-2               |     raise ImproperlyConfigured(
    pulp_content-2               | django.core.exceptions.ImproperlyConfigured: Could not load DB_ENCRYPTION_KEY file '/etc/pulp/certs/database_fields.symmetric.key': [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_content-1 exited with code 0
    set_init_password_service-1 exited with code 0
    pulp_worker-1 exited with code 0
    pulp_worker-2 exited with code 0
    pulp_content-2 exited with code 0
    pulp_worker-2                | Waiting on postgresql to start...
    pulp_worker-2                | Traceback (most recent call last):
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 89, in _lock_storage
    pulp_worker-2                |     asyncio.get_running_loop()
    pulp_worker-2                | RuntimeError: no running event loop
    pulp_worker-2                | 
    pulp_worker-2                | During handling of the above exception, another exception occurred:
    pulp_worker-2                | 
    pulp_worker-2                | Traceback (most recent call last):
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 58, in __getitem__
    pulp_worker-2                |     return getattr(self._connections, alias)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 118, in __getattr__
    pulp_worker-2                |     return getattr(storage, key)
    pulp_worker-2                | AttributeError: '_thread._local' object has no attribute 'default'
    pulp_worker-2                | 
    pulp_worker-2                | During handling of the above exception, another exception occurred:
    pulp_worker-2                | 
    pulp_worker-2                | Traceback (most recent call last):
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in 
    pulp_worker-2                |     with open(DB_ENCRYPTION_KEY, "rb") as key_file:
    pulp_worker-2                | PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_worker-2                | 
    pulp_worker-2                | During handling of the above exception, another exception occurred:
    pulp_worker-2                | 
    pulp_worker-2                | Traceback (most recent call last):
    pulp_worker-2                |   File "/usr/bin/wait_on_postgres.py", line 12, in 
    pulp_worker-2                |     connection.ensure_connection()
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
    pulp_worker-2                |     return getattr(self._connections[self._alias], item)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 60, in __getitem__
    pulp_worker-2                |     if alias not in self.settings:
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    pulp_worker-2                |     res = instance.__dict__[self.name] = self.func(instance)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 45, in settings
    pulp_worker-2                |     self._settings = self.configure_settings(self._settings)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 148, in configure_settings
    pulp_worker-2                |     databases = super().configure_settings(databases)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 50, in configure_settings
    pulp_worker-2                |     settings = getattr(django_settings, self.settings_name)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 102, in __getattr__
    pulp_worker-2                |     self._setup(name)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 89, in _setup
    pulp_worker-2                |     self._wrapped = Settings(settings_module)
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 217, in __init__
    pulp_worker-2                |     mod = importlib.import_module(self.SETTINGS_MODULE)
    pulp_worker-2                |   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    pulp_worker-2                |     return _bootstrap._gcd_import(name[level:], package, level)
    pulp_worker-2                |   File "", line 1030, in _gcd_import
    pulp_worker-2                |   File "", line 1007, in _find_and_load
    pulp_worker-2                |   File "", line 986, in _find_and_load_unlocked
    pulp_worker-2                |   File "", line 680, in _load_unlocked
    pulp_worker-2                |   File "", line 850, in exec_module
    pulp_worker-2                |   File "", line 228, in _call_with_frames_removed
    pulp_worker-2                |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 477, in 
    pulp_worker-2                |     raise ImproperlyConfigured(
    pulp_worker-2                | django.core.exceptions.ImproperlyConfigured: Could not load DB_ENCRYPTION_KEY file '/etc/pulp/certs/database_fields.symmetric.key': [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_worker-1                | Waiting on postgresql to start...
    pulp_worker-1                | Traceback (most recent call last):
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 89, in _lock_storage
    pulp_worker-1                |     asyncio.get_running_loop()
    pulp_worker-1                | RuntimeError: no running event loop
    pulp_worker-1                | 
    pulp_worker-1                | During handling of the above exception, another exception occurred:
    pulp_worker-1                | 
    pulp_worker-1                | Traceback (most recent call last):
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 58, in __getitem__
    pulp_worker-1                |     return getattr(self._connections, alias)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 118, in __getattr__
    pulp_worker-1                |     return getattr(storage, key)
    pulp_worker-1                | AttributeError: '_thread._local' object has no attribute 'default'
    pulp_worker-1                | 
    pulp_worker-1                | During handling of the above exception, another exception occurred:
    pulp_worker-1                | 
    pulp_worker-1                | Traceback (most recent call last):
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in 
    pulp_worker-1                |     with open(DB_ENCRYPTION_KEY, "rb") as key_file:
    pulp_worker-1                | PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_worker-1                | 
    pulp_worker-1                | During handling of the above exception, another exception occurred:
    pulp_worker-1                | 
    pulp_worker-1                | Traceback (most recent call last):
    pulp_worker-1                |   File "/usr/bin/wait_on_postgres.py", line 12, in 
    pulp_worker-1                |     connection.ensure_connection()
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
    pulp_worker-1                |     return getattr(self._connections[self._alias], item)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 60, in __getitem__
    pulp_worker-1                |     if alias not in self.settings:
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    pulp_worker-1                |     res = instance.__dict__[self.name] = self.func(instance)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 45, in settings
    pulp_worker-1                |     self._settings = self.configure_settings(self._settings)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 148, in configure_settings
    pulp_worker-1                |     databases = super().configure_settings(databases)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 50, in configure_settings
    pulp_worker-1                |     settings = getattr(django_settings, self.settings_name)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 102, in __getattr__
    pulp_worker-1                |     self._setup(name)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 89, in _setup
    pulp_worker-1                |     self._wrapped = Settings(settings_module)
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 217, in __init__
    pulp_worker-1                |     mod = importlib.import_module(self.SETTINGS_MODULE)
    pulp_worker-1                |   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    pulp_worker-1                |     return _bootstrap._gcd_import(name[level:], package, level)
    pulp_worker-1                |   File "", line 1030, in _gcd_import
    pulp_worker-1                |   File "", line 1007, in _find_and_load
    pulp_worker-1                |   File "", line 986, in _find_and_load_unlocked
    pulp_worker-1                |   File "", line 680, in _load_unlocked
    pulp_worker-1                |   File "", line 850, in exec_module
    pulp_worker-1                |   File "", line 228, in _call_with_frames_removed
    pulp_worker-1                |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 477, in 
    pulp_worker-1                |     raise ImproperlyConfigured(
    pulp_worker-1                | django.core.exceptions.ImproperlyConfigured: Could not load DB_ENCRYPTION_KEY file '/etc/pulp/certs/database_fields.symmetric.key': [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_content-1               | Waiting on postgresql to start...
    pulp_content-1               | Traceback (most recent call last):
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 89, in _lock_storage
    pulp_content-1               |     asyncio.get_running_loop()
    pulp_content-1               | RuntimeError: no running event loop
    pulp_content-1               | 
    pulp_content-1               | During handling of the above exception, another exception occurred:
    pulp_content-1               | 
    pulp_content-1               | Traceback (most recent call last):
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 58, in __getitem__
    pulp_content-1               |     return getattr(self._connections, alias)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 118, in __getattr__
    pulp_content-1               |     return getattr(storage, key)
    pulp_content-1               | AttributeError: '_thread._local' object has no attribute 'default'
    pulp_content-1               | 
    pulp_content-1               | During handling of the above exception, another exception occurred:
    pulp_content-1               | 
    pulp_content-1               | Traceback (most recent call last):
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in 
    pulp_content-1               |     with open(DB_ENCRYPTION_KEY, "rb") as key_file:
    pulp_content-1               | PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_content-1               | 
    pulp_content-1               | During handling of the above exception, another exception occurred:
    pulp_content-1               | 
    pulp_content-1               | Traceback (most recent call last):
    pulp_content-1               |   File "/usr/bin/wait_on_postgres.py", line 12, in 
    pulp_content-1               |     connection.ensure_connection()
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
    pulp_content-1               |     return getattr(self._connections[self._alias], item)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 60, in __getitem__
    pulp_content-1               |     if alias not in self.settings:
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    pulp_content-1               |     res = instance.__dict__[self.name] = self.func(instance)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 45, in settings
    pulp_content-1               |     self._settings = self.configure_settings(self._settings)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 148, in configure_settings
    pulp_content-1               |     databases = super().configure_settings(databases)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 50, in configure_settings
    pulp_content-1               |     settings = getattr(django_settings, self.settings_name)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 102, in __getattr__
    pulp_content-1               |     self._setup(name)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 89, in _setup
    pulp_content-1               |     self._wrapped = Settings(settings_module)
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 217, in __init__
    pulp_content-1               |     mod = importlib.import_module(self.SETTINGS_MODULE)
    pulp_content-1               |   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    pulp_content-1               |     return _bootstrap._gcd_import(name[level:], package, level)
    pulp_content-1               |   File "", line 1030, in _gcd_import
    pulp_content-1               |   File "", line 1007, in _find_and_load
    pulp_content-1               |   File "", line 986, in _find_and_load_unlocked
    pulp_content-1               |   File "", line 680, in _load_unlocked
    pulp_content-1               |   File "", line 850, in exec_module
    pulp_content-1               |   File "", line 228, in _call_with_frames_removed
    pulp_content-1               |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 477, in 
    pulp_content-2               | Waiting on postgresql to start...
    pulp_content-2               | Traceback (most recent call last):
    pulp_content-1               |     raise ImproperlyConfigured(
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 89, in _lock_storage
    pulp_content-1               | django.core.exceptions.ImproperlyConfigured: Could not load DB_ENCRYPTION_KEY file '/etc/pulp/certs/database_fields.symmetric.key': [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_content-2               |     asyncio.get_running_loop()
    pulp_content-2               | RuntimeError: no running event loop
    pulp_content-2               | 
    pulp_content-2               | During handling of the above exception, another exception occurred:
    pulp_content-2               | 
    pulp_content-2               | Traceback (most recent call last):
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 58, in __getitem__
    pulp_content-2               |     return getattr(self._connections, alias)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/asgiref/local.py", line 118, in __getattr__
    pulp_content-2               |     return getattr(storage, key)
    pulp_content-2               | AttributeError: '_thread._local' object has no attribute 'default'
    pulp_content-2               | 
    pulp_content-2               | During handling of the above exception, another exception occurred:
    pulp_content-2               | 
    pulp_content-2               | Traceback (most recent call last):
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in 
    pulp_content-2               |     with open(DB_ENCRYPTION_KEY, "rb") as key_file:
    pulp_content-2               | PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    pulp_content-2               | 
    pulp_content-2               | During handling of the above exception, another exception occurred:
    pulp_content-2               | 
    pulp_content-2               | Traceback (most recent call last):
    pulp_content-2               |   File "/usr/bin/wait_on_postgres.py", line 12, in 
    pulp_content-2               |     connection.ensure_connection()
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
    pulp_content-2               |     return getattr(self._connections[self._alias], item)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 60, in __getitem__
    pulp_content-2               |     if alias not in self.settings:
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    pulp_content-2               |     res = instance.__dict__[self.name] = self.func(instance)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 45, in settings
    pulp_content-2               |     self._settings = self.configure_settings(self._settings)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 148, in configure_settings
    pulp_content-2               |     databases = super().configure_settings(databases)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 50, in configure_settings
    pulp_content-2               |     settings = getattr(django_settings, self.settings_name)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 102, in __getattr__
    pulp_content-2               |     self._setup(name)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 89, in _setup
    pulp_content-2               |     self._wrapped = Settings(settings_module)
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 217, in __init__
    pulp_content-2               |     mod = importlib.import_module(self.SETTINGS_MODULE)
    pulp_content-2               |   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    pulp_content-2               |     return _bootstrap._gcd_import(name[level:], package, level)
    pulp_content-2               |   File "", line 1030, in _gcd_import
    pulp_content-2               |   File "", line 1007, in _find_and_load
    pulp_content-2               |   File "", line 986, in _find_and_load_unlocked
    pulp_content-2               |   File "", line 680, in _load_unlocked
    pulp_content-2               |   File "", line 850, in exec_module
    pulp_content-2               |   File "", line 228, in _call_with_frames_removed
    pulp_content-2               |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 477, in 
    pulp_content-2               |     raise ImproperlyConfigured(
    pulp_content-2               | django.core.exceptions.ImproperlyConfigured: Could not load DB_ENCRYPTION_KEY file '/etc/pulp/certs/database_fields.symmetric.key': [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'
    signing_key_service-1        | Database migrated!
    signing_key_service-1        | /usr/bin/add_signing_service.sh: line 6: PULP_SIGNING_KEY_FINGERPRINT: unbound variable
    Gracefully stopping... (press Ctrl+C again to force)
    service "signing_key_service" didn't complete successfully: exit 1

It seems nobody else has those problems, so maybe something with my host-system is wrong? Help would be apreciated, because I really would like to test pulp.

gerrod3 commented 2 months ago

Did you follow the instructions from here: https://pulpproject.org/pulp-oci-images/docs/admin/tutorials/quickstart/#single-container? I just did it on Fedora 40, docker 24.0.5 and it worked fine for me. What does your logs look like for the single container, docker logs pulp?

urzparat commented 2 months ago

Thank you for your reply!

  1. I created the folder as described.
  2. Created the settings.py and additionally added TOKEN_AUTH_DISABLED=true
  3. Started docker with the command described in my first post.

Logs show the following:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pulpcore/app/settings.py", line 474, in <module>
    with open(DB_ENCRYPTION_KEY, "rb") as key_file:
PermissionError: [Errno 13] Permission denied: '/etc/pulp/certs/database_fields.symmetric.key'

Do I need to generate this key?

gerrod3 commented 2 months ago

No this key should be generated on the first run of the container. Can you see if this file exists already in your settings/certs/ folder? And if it does exist can you check who has perms on this file? On my system the file has these perms:

-rw-r-----. 1 root      700   45 Sep 16 16:23 database_fields.symmetric.key

The 700 user should be the pulp user inside the container which is what allows Pulp to read this file. If the file doesn't exist then I would remove the container and rerun the docker run command.

urzparat commented 2 months ago

The following files exist:

└── settings
    ├── certs
    │   ├── database_fields.symmetric.key
    │   ├── pulp_webserver.crt
    │   ├── pulp_webserver.csr
    │   ├── pulp_webserver.key
    │   ├── token_private_key.pem
    │   └── token_public_key.pem
    └── settings.py

And the permissions of the key are the same as you've listed:

-rw-r----- 1 root        700   45 17. Sep 07:45 database_fields.symmetric.key
gerrod3 commented 2 months ago

Strange, does your system have selinux enabled perchance? I'm not exactly sure what other reasons there could be for the container to not be able to read the file, maybe docker root user issue? https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user

urzparat commented 2 months ago

Well when its something with my system, I'd best try it on a clean machine. Thank you for your time and sorry for the noise.