Chu_bot
Chu_bot

Reputation: 75

Why is gunicorn not being added to path in an AWS App Runner Flask App?

I receive the following error:

Invalid start command. Update the start command you provided during the App Runner service configuration and re-try. - CannotStartContainerError: ResourceInitializationError: failed to create new container runtime task: failed to create shim task: failed to create task: rpc error: code = Unknown desc = OCI runtime create failed: runc create failed: unable to start container process: exec: "gunicorn": executable file not found in $PATH: unknown

gunicorn is installed by the requirements.txt

11-08-2024 11:30:29 AM [Build] Collecting gunicorn==22.0.0 (from -r requirements.txt (line 51))

11-08-2024 11:30:29 AM [Build] Downloading gunicorn-22.0.0-py3-none-any.whl.metadata (4.4 kB)

There is a warning

11-08-2024 11:31:59 AM [Build] [91mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

but I believe this is the correct way to run the build commands in app runner (It's straight from the example):

Configuration source
API
Runtime
Python 3.11
Start command
gunicorn --bind '0.0.0.0:8000' app:server
Build command
pip3 install -r requirements.txt
Port
8000

Any other examples I can find of this problem is people just forgetting to include gunicorn in their requirements.

Upvotes: 0

Views: 84

Answers (1)

Jio Du
Jio Du

Reputation: 11

Save issues as yours. so far i only find one way to make it choose python3 instead of python 3.11 then

-f https://download.pytorch.org/whl/torch_stable.html
Flask==2.2.2
pandas==1.3.5
numpy==1.21.6
fair-esm==2.0.0
keras==2.11.0
scikit-learn===1.0.2
tensorflow-cpu== 2.11.0
torch==1.12.0+cpu
joblib==1.2.0
gunicorn==20.1.0
werkzeug==2.2.2
openpyxl==3.0.9

Upvotes: 0

Related Questions