Error during upload, status code 400 // The server was unable to complete your request

Hi,

NOTE: I am creating a new topic so not to revive an older topic which addresses the same issue (HERE ).

I am a zero day newbie here looking for a little help so I am sorry in advanced for not knowing what I am doing.

My issues appear to stem from the fact that I have my storage moved to a USB harddrive (based on instructions from HERE ).

I have a NextCloudPi 1.55.3 and a Raspberry Pi 5.

Nextcloud version 30.0.1.2
NextcloudPi version v1.55.3

Upon uploading in browser I get a status 400 error:

Error#1

For sake of full context I include nonsense iPhone Nextcloud app error related to the issue at hand.

And I see in the logs:

Expected filesize of ### bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes…

Unable to create temporary file, Check permissions in temporary files directory.

temp_permissions

Yet my php file looks ok to me.
php-info
php_content

NC-ACCESS.LOG

> 12.34.56.789 - - [05/Dec/2024:04:10:32 +0000] "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/2.0" 200 237 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"
> 12.34.56.789 - - [05/Dec/2024:04:10:32 +0000] "PUT /remote.php/dav/files/MyUsername/2013%2006%2022%20Marc%20Marquez.jpg HTTP/2.0" 400 800 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"

Nextcloud.log

> {"reqId":"Z1EnuO-cugfrJ2_gwGK0CwAAgwg","level":3,"time":"2024-12-05T04:10:32+00:00","remoteAddr":"12.34.56.789","user":"MyUsername","app":"PHP","method":"PUT","url":"/remote.php/dav/files/MyUsername/2013%2006%2022%20Marc%20Marquez.jpg","message":"fread(): file created in the system's temporary directory at /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php#55","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.1.2","data":{"app":"PHP"}}
> {"reqId":"Z1EnuO-cugfrJ2_gwGK0CwAAgwg","level":3,"time":"2024-12-05T04:10:32+00:00","remoteAddr":"12.34.56.789","user":"MyUsername","app":"PHP","method":"PUT","url":"/remote.php/dav/files/MyUsername/2013%2006%2022%20Marc%20Marquez.jpg","message":"fread(): Unable to create temporary file, Check permissions in temporary files directory. at /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php#55","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.1.2","data":{"app":"PHP"}}
> {"reqId":"Z1EnuO-cugfrJ2_gwGK0CwAAgwg","level":3,"time":"2024-12-05T04:10:32+00:00","remoteAddr":"12.34.56.789","user":"MyUsername","app":"no app in context","method":"PUT","url":"/remote.php/dav/files/MyUsername/2013%2006%2022%20Marc%20Marquez.jpg","message":"Expected filesize of 257626 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.1.2","exception":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 257626 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":110,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":43,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":370,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":19,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":146,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":259,"message":"Expected filesize of 257626 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","exception":{},"CustomMessage":"Expected filesize of 257626 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side."}}

While poking around I can see that this issue is affecting updating a user’s avatar. too

unable_proceed

error_saving_pic

NEXTCLOUD.LOG

{"reqId":"Z1FNEu2L27SQKTJbbUNzvAAAwww","level":2,"time":"2024-12-05T06:49:54+00:00","remoteAddr":"12.34.56.789","user":"MyUsername","app":"core","method":"POST","url":"/index.php/avatar","message":"Missing a temporary folder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.1.2","data":{"app":"core"}}
{"reqId":"Z1FNEu2L27SQKTJbbUNzvAAAwww","level":3,"time":"2024-12-05T06:49:54+00:00","remoteAddr":"12.34.56.789","user":"MyUsername","app":"PHP","method":"POST","url":"/index.php/avatar","message":"File upload error - unable to create a temporary file at Unknown#0","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.1.2","data":{"app":"PHP"}}
{"reqId":"Z1FNMe-cugfrJ2_gwGK3aAAAiAY","level":2,"time":"2024-12-05T06:50:27+00:00","remoteAddr":"12.34.56.789","user":"MyUsername","app":"core","method":"POST","url":"/index.php/avatar","message":"Missing a temporary folder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.1.2","data":{"app":"core"}}
{"reqId":"Z1FNMe-cugfrJ2_gwGK3aAAAiAY","level":3,"time":"2024-12-05T06:50:27+00:00","remoteAddr":"12.34.56.789","user":"MyUsername","app":"PHP","method":"POST","url":"/index.php/avatar","message":"File upload error - unable to create a temporary file at Unknown#0","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","version":"30.0.1.2","data":{"app":"PHP"}}

NC-ERROR.LOG

[Thu Dec 05 06:49:54.294656 2024] [proxy_fcgi:error] [pid 15537:tid 15565] [remote 12.34.56.789:63709] AH01071: Got error 'PHP message: PHP Notice:  PHP Request Startup: file created in the system's temporary directory in Unknown on line 0; PHP message: PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0'
[Thu Dec 05 06:50:27.105045 2024] [proxy_fcgi:error] [pid 15526:tid 15533] [remote 12.34.56.789:63734] AH01071: Got error 'PHP message: PHP Notice:  PHP Request Startup: file created in the system's temporary directory in Unknown on line 0; PHP message: PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0'

Well it appears that even in Linux world a little reboot here and there doesn’t hurt!!! :eyes:
Now uploads are working! Well thank you everyone nonetheless! lol!