Errors when start pulp-minimal pulp-api service

Problem:
Got error when run:
podman run --name pulp-api --publish 24817:24817 -e POSTGRES_SERVICE_HOST=‘dbhost’ -e POSTGRES_SERVICE_PORT=10000 sth/bb-pulp-minimal:latest pulp-api

“This app must be executed using pulpcore-api entrypoint.”

Expected outcome:

Pulpcore version:
3.36.0

Pulp plugins installed and their versions:
pulp-ansible 0.20.0
pulp-certguard 1.6.5
pulp-container 2.16.2
pulp-deb 3.0.0
pulp-file 1.14.5
pulp-gem 0.3.0
pulp-glue 0.21.3
pulp-maven 0.6.0
pulp-ostree 2.1.3
pulp-python 3.10.0
pulp-rpm 3.22.5
pulpcore 3.36.0

external redis, postgres and s3 storage

Operating system - distribution and version:
rhel 8.6
Other relevant data:

We are trying to run pulp-minimal on different hosts instead use docker compose on a single host. We cannot use k8s due to security reasons. From https://github.com/pulp/pulp-oci-images/blob/latest/images/compose/compose.yml#L92, it looks like we should be able to run command pulp-api but we got the below errors. What is the right way to start pulp-api service without using composer?

  • exec gunicorn --bind ‘[::]:24817’ pulpcore.app.wsgi:application --name pulp-api --timeout 90 --workers 2
    [2023-12-13 18:30:17 +0000] [1] [INFO] Starting gunicorn 21.2.0
    [2023-12-13 18:30:17 +0000] [1] [INFO] Listening at: http://[::]:24817 (1)
    [2023-12-13 18:30:17 +0000] [1] [INFO] Using worker: sync
    [2023-12-13 18:30:17 +0000] [14] [INFO] Booting worker with pid: 14
    [2023-12-13 18:30:17 +0000] [15] [INFO] Booting worker with pid: 15
    [2023-12-13 18:30:18 +0000] [14] [ERROR] Exception in worker process
    Traceback (most recent call last):
    File “/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py”, line 609, in spawn_worker
    worker.init_process()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py”, line 134, in init_process
    self.load_wsgi()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py”, line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py”, line 67, in wsgi
    self.callable = self.load()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py”, line 58, in load
    return self.load_wsgiapp()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py”, line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
    File “/usr/local/lib/python3.8/site-packages/gunicorn/util.py”, line 371, in import_app
    mod = importlib.import_module(module)
    File “/usr/lib64/python3.8/importlib/init.py”, line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File “”, line 1014, in _gcd_import
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “”, line 843, in exec_module
    File “”, line 219, in _call_with_frames_removed
    File “/usr/local/lib/python3.8/site-packages/pulpcore/app/wsgi.py”, line 17, in
    raise RuntimeError(“This app must be executed using pulpcore-api entrypoint.”)
    RuntimeError: This app must be executed using pulpcore-api entrypoint.
    [2023-12-13 18:30:18 +0000] [14] [INFO] Worker exiting (pid: 14)
    [2023-12-13 18:30:18 +0000] [15] [ERROR] Exception in worker process
    Traceback (most recent call last):
    File “/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py”, line 609, in spawn_worker
    worker.init_process()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py”, line 134, in init_process
    self.load_wsgi()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py”, line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py”, line 67, in wsgi
    self.callable = self.load()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py”, line 58, in load
    return self.load_wsgiapp()
    File “/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py”, line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
    File “/usr/local/lib/python3.8/site-packages/gunicorn/util.py”, line 371, in import_app
    mod = importlib.import_module(module)
    File “/usr/lib64/python3.8/importlib/init.py”, line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File “”, line 1014, in _gcd_import
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “”, line 843, in exec_module
    File “”, line 219, in _call_with_frames_removed
    File “/usr/local/lib/python3.8/site-packages/pulpcore/app/wsgi.py”, line 17, in
    raise RuntimeError(“This app must be executed using pulpcore-api entrypoint.”)
    RuntimeError: This app must be executed using pulpcore-api entrypoint.

You no longer can execute pulp services like this.

Visit https://github.com/pulp/pulp-oci-images/blob/e7dfdbd716ae93000a4cf341c14001c4f33b66c8/images/assets/pulp-api#L8 and Add records for Api app status by mdellweg · Pull Request #4249 · pulp/pulpcore · GitHub for more details.