Skip to content

CancelledError raised on app startup in Argo CD #2509

Closed as not planned
Closed as not planned
@ishaan-mehta

Description

@ishaan-mehta

I have a FastAPI app that uses uvicorn, and when I run locally with Docker on colima, I never encounter this error, but when I run that same app in Argo CD, I keep seeing the following error and the app immediately shuts down:

INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
ERROR:    Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 700, in lifespan
    await receive()
  File "/usr/local/lib/python3.12/site-packages/uvicorn/lifespan/on.py", line 137, in receive
    return await self.receive_queue.get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/queues.py", line 158, in get
    await getter
asyncio.exceptions.CancelledError

(This is transient, however — very rarely, the app does manage to get past this and start without issue.)

As far as I can tell, this error is never supposed to actually surface to the user. How can I solve this? Is this an issue with uvicorn? An issue with starlette? (I am not using Ctrl-C or interacting with the app at all, which I have seen suggested on similar discussions online.)

Originally posted by @ishaan-mehta in #2495

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions