[Django] #33395: No error raised when FILE_UPLOAD_TEMP_DIR is not accessible

5 views
Skip to first unread message

Django

unread,
Dec 29, 2021, 5:02:17 AM12/29/21
to django-...@googlegroups.com
#33395: No error raised when FILE_UPLOAD_TEMP_DIR is not accessible
-------------------------------------+-------------------------------------
Reporter: Martin | Owner: nobody
Koščak |
Type: | Status: new
Uncategorized |
Component: File | Version: 3.2
uploads/storage | Keywords: empty request large
Severity: Normal | file upload
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This one took me a while to figure out, so I'm creating a ticket.
The initial issue I had was, when I uploaded a larger file (+10MB), I
received no data in request. The POST, GET and FILES attributes of request
were all empty, only META attribute was OK.

After a lot of digging I've found the root of my problem. I had invalid
ownership set on FILE_UPLOAD_TEMP_DIR.
Once the file exceeded FILE_UPLOAD_MAX_MEMORY_SIZE and was deemed as
TemporaryUploadedFile, something happened, and I received an empty
request.

This could be solved much sooner, if an Exception was raised.
This happened in production environment with Apache and WSGI.

--
Ticket URL: <https://code.djangoproject.com/ticket/33395>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 29, 2021, 5:10:42 AM12/29/21
to django-...@googlegroups.com
#33395: No error raised when FILE_UPLOAD_TEMP_DIR is not accessible
-------------------------------------+-------------------------------------
Reporter: Martin Koščak | Owner: nobody
Type: Bug | Status: closed
Component: Core (Other) | Version: 3.2
Severity: Normal | Resolution: duplicate
Keywords: empty request large | Triage Stage:
file upload | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate
* component: File uploads/storage => Core (Other)
* type: Uncategorized => Bug


Comment:

Thanks for the report. It should be fixed in Django 4.0, see #32329,
#32360, and related commits 00ea883ef56fb5e092cbe4a6f7ff2e7470886ac4 and
b1821fbad5518c8ae56b7b5c2b1ea2afbbd25c7a.

--
Ticket URL: <https://code.djangoproject.com/ticket/33395#comment:1>

Reply all
Reply to author
Forward
0 new messages