I start my app with
gunicorn app.app:app -w 2 --threads 2 -b 0.0.0.0:8080 -k uvicorn.workers.UvicornWorker
and I get error “[ERROR] Failed to add operation for GET /foo” and trying to reach endpoint in browser show “Internal Server Error”.
I have installed requirements by
python -m pip -r requirements.txt
and my requirements file:
gunicorn==21.2.0
connexion[uvicorn,flask]==3.0.6
Script code in app.py
def foo() -> str:
return f"Foo"
app = FlaskApp(__name__)
app.add_api("openapi.yaml", arguments={"title": "Bar"})
and the important stuff from openapi looks like
paths:
/foo:
get:
operationId: app.foo
summary: Foo
description: Foo foo
I am usin Python 3.11.7.
what am I missing?
The api works fine when I run, no errors in the logs and the browser show expected result
connexion run openapi.yaml
The program show no erros when I run with python
python app.py
I have tried different requirements combinations of gunicorn/uvicorn/flask and tried started gunicorn with/without -k uvicorn.workers.UvicornWorker.