Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with creating/streaming result archives: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmptw7ew4ln/results-*.tar.gz' #157

Closed
TomasTomecek opened this issue Aug 16, 2024 · 1 comment · Fixed by #159
Assignees
Labels
bug Something isn't working

Comments

@TomasTomecek
Copy link
Collaborator

We have a ton of these tracebacks in the logs:

[2024-08-16 15:03:49 +0000] [7] [ERROR] Exception in ASGI application
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 426, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/usr/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/usr/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/lib/python3.12/site-packages/starlette/routing.py", line 75, in app
    await response(scope, receive, send)
  File "/usr/lib/python3.12/site-packages/starlette/responses.py", line 258, in __call__
    async with anyio.create_task_group() as task_group:
  File "/usr/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 597, in __aexit__
    raise exceptions[0]
  File "/usr/lib/python3.12/site-packages/starlette/responses.py", line 261, in wrap
    await func()
  File "/usr/lib/python3.12/site-packages/starlette/responses.py", line 250, in stream_response
    async for chunk in self.body_iterator:
  File "/usr/lib/python3.12/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
    yield await anyio.to_thread.run_sync(_next, as_iterator)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/starlette/concurrency.py", line 54, in _next
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/src/backend/src/api.py", line 350, in iter_large_file
    with open(file_name, mode="rb") as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmptw7ew4ln/results-1723820620.tar.gz'
@TomasTomecek
Copy link
Collaborator Author

Unfortunately, the downloading is now broken :/

image

@TomasTomecek TomasTomecek added the bug Something isn't working label Aug 16, 2024
@TomasTomecek TomasTomecek self-assigned this Aug 22, 2024
TomasTomecek added a commit to TomasTomecek/log-detective-website that referenced this issue Aug 22, 2024
I had to rewrite the function from an async implementataion that stopped
working (probably after an update to fastapi and starlette).

Fixes: fedora-copr#157

Signed-off-by: Tomas Tomecek <[email protected]>
TomasTomecek added a commit to TomasTomecek/log-detective-website that referenced this issue Aug 29, 2024
I had to rewrite the function from an async implementataion that stopped
working (probably after an update to fastapi and starlette).

Fixes: fedora-copr#157

Signed-off-by: Tomas Tomecek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant