Skip to content

Fix: Handle RuntimeError: No response returned. Errors#582

Merged
ekassos merged 4 commits intomainfrom
fix-fastapi
Nov 8, 2024
Merged

Fix: Handle RuntimeError: No response returned. Errors#582
ekassos merged 4 commits intomainfrom
fix-fastapi

Conversation

@ekassos
Copy link
Member

@ekassos ekassos commented Oct 27, 2024

Fixes #569 by upgrading starlette through a FastAPI upgrade. For background on this error see the discussion in the starlette repo here.

Resolves #550 by upgrading the Docker commands to use fastapi run. Note however that fastapi run is simply a wrapper calling uvicorn, with less options. See here.

@ekassos
Copy link
Member Author

ekassos commented Oct 27, 2024

/test-on-staging

@ekassos
Copy link
Member Author

ekassos commented Oct 27, 2024

/test-on-staging all

@ekassos ekassos marked this pull request as ready for review October 27, 2024 20:19

srv:
command: ["gunicorn", "pingpong:server", "-k", "uvicorn_worker.UvicornWorker", "-b", "0.0.0.0:8000", "--workers", "4", "--log-level", "debug"]
command: ["fastapi", "dev", "pingpong", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my memory about this is fuzzy, but IIRC I never wanted to pass debug here in the first place, but using our env variable didn't work. (Python logging configuration is initialization order dependent and it always confused me.) You can try setting the environment LOG_LEVEL=DEBUG to keep the same log level. But it's not really an issue either way.

@ekassos ekassos added this to the v2.0.1 milestone Oct 27, 2024
@ekassos ekassos self-assigned this Oct 27, 2024
@ekassos ekassos requested a review from jnu October 27, 2024 20:26
@ekassos ekassos modified the milestones: v2.0.1, v2.0.4 Oct 27, 2024

srv:
command: ["gunicorn", "pingpong:server", "-k", "uvicorn_worker.UvicornWorker", "-b", "0.0.0.0:8000", "--workers", "4", "--log-level", "debug"]
command: ["fastapi", "dev", "pingpong", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my memory about this is fuzzy, but IIRC I never wanted to pass debug here in the first place, but using our env variable didn't work. (Python logging configuration is initialization order dependent and it always confused me.) You can try setting the environment LOG_LEVEL=DEBUG to keep the same log level. But it's not really an issue either way.

@ekassos ekassos merged commit c380b07 into main Nov 8, 2024
@ekassos ekassos deleted the fix-fastapi branch November 8, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle RuntimeError: No response returned. Errors Upgrade fastapi and container CMD

2 participants