[Unit] Django/Python - mkstemp No such file or directory

doolijb

New member
Joined
Dec 12, 2021
Messages
3
I opened a ticket, but figured I'd ask here in case the community has any answers since it's the weekend.

Client can't upload files/images from their django application.

unit.log reads:
2021/12/11 21:37:01 [alert] 817#882 *21 mkstemp(/usr/tmp/req-XXP6jxDX) failed (2: No such file or directory)

This issue only occurred after migrating to DirectAdmin/Unit.

Closest answer I could find was this:
But I'm at a loss on if this would apply, or where the files are located with DirectAdmin
 
I did find /etc/systemd/system/unit.service, PrivateTmp=false yielded no results.
 
For some reason it's trying to use /usr/tmp as the directory instead of just /tmp.
 
Yesterday I did create a /usr/tmp with public permissions while troubleshooting, no dice.
 
Please try:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build unit
 
I had this same error today:

2022/01/31 13:34:55.373 [debug] 562273#562284 *379172 timer found minimum: 1319051974±50:1318899142 2022/01/31 13:34:55.373 [debug] 562273#562284 epoll_wait(30) timeout:152832 2022/01/31 13:34:55.593 [debug] 562273#562284 epoll_wait(30): 1 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 epoll: fd:419 ev:0001 d:7F95540322F0 rd:5 wr:0 2022/01/31 13:34:55.593 [debug] 562273#562284 timer expire minimum: 1319051924:1318899362 2022/01/31 13:34:55.593 [debug] 562273#562284 work queue: read 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 conn read fd:419 rdy:1 cl:0 er:0 bl:0 2022/01/31 13:34:55.593 [debug] 562273#562284 recvbuf: 0, 7F95540551D8, 2048 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 recv(419, 7F95540551D8, 2048, 0x0): 2048 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 timer disable: 1319073778 2022/01/31 13:34:55.593 [debug] 562273#562284 work queue: fast 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 h1p conn request init 2022/01/31 13:34:55.593 [debug] 562273#562284 malloc(184): 7F955400CB10 2022/01/31 13:34:55.593 [debug] 562273#562284 posix_memalign(16, 568): 7F9554032840 2022/01/31 13:34:55.593 [debug] 562273#562284 malloc(232): 7F95540604D0 2022/01/31 13:34:55.593 [debug] 562273#562284 posix_memalign(128, 4096): 7F9554010700 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 h1p conn header parse 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 timer disable: 1319073778 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 h1p request body read 167269 te:0 2022/01/31 13:34:55.593 [debug] 562273#562284 posix_memalign(16, 16584): 7F9554070710 2022/01/31 13:34:55.593 [alert] 562273#562284 *379175 mkstemp(/usr/tmp/req-XXbfpZoF) failed (2: No such file or directory) 2022/01/31 13:34:55.593 [debug] 562273#562284 *379175 http request error: 500

I noticed on unitd

--tmp DIRECTORY set tmp directory name
default: "/usr/tmp"

So it defaults to /usr/tmp


This was resolved if I symlinked /usr/tmp to /tmp although a better practice would be setting a known /tmp folder
 
although a better practice would be setting a known /tmp folder
You might want to take that up with Django or whatever you are using because /tmp is a known /tmp folder, maybe even the most wel known one next to /var/tmp.
Some other panel out there also symlinks /usr/tmp to /var/tmp by the way...
 
Ah, I don't work with nginx, still it's odd then because DA normally sets the tmp directory to /tmp and apache is using that too, so odd that nginx does not also use that setting.
However, since I don't use nginx, I won't mingle in the thraed further, sorry.
 
Back
Top