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

Cannot get request files with NGINX #345

Open
dm-sizov opened this issue Jun 2, 2024 · 1 comment
Open

Cannot get request files with NGINX #345

dm-sizov opened this issue Jun 2, 2024 · 1 comment

Comments

@dm-sizov
Copy link

dm-sizov commented Jun 2, 2024

I can't access the file from request.files even the first time I access it. Without NGINX everything works fine, the configuration does not help. The same code with the same configuration works in Flask.

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/quart/app.py", line 1403, in handle_request
    return await self.full_dispatch_request(request_context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/quart_flask_patch/app.py", line 27, in new_full_dispatch_request
    return await old_full_dispatch_request(self, request_context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/quart/app.py", line 1441, in full_dispatch_request
    result = await self.handle_user_exception(error)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/quart/app.py", line 1029, in handle_user_exception
    raise error
  File "/usr/local/lib/python3.11/site-packages/quart/app.py", line 1439, in full_dispatch_request
    result = await self.dispatch_request(request_context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/quart/app.py", line 1535, in dispatch_request
    return await self.ensure_async(handler)(**request_.view_args)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/quart_auth/globals.py", line 64, in wrapper
    return await current_app.ensure_async(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/quart/views.py", line 62, in view
    return await current_app.ensure_async(self.dispatch_request)(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/quart/views.py", line 127, in dispatch_request
    return await current_app.ensure_async(handler)(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/********/*****/*********/*******/views.py", line 360, in post
    file.stream.seek(0)
  File "/usr/local/lib/python3.11/tempfile.py", line 825, in seek
    return self._file.seek(*args)
           ^^^^^^^^^^^^^^^^^^^^^^
ValueError: I/O operation on closed file.

Environment:

  • Python version: 3.11.9
  • Quart version: 0.19.6
@evgenii-moriakhin
Copy link

please provide nginx configuration

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

No branches or pull requests

2 participants