"HEADERS on invalid stream"

The Linux client 2.6.1git displays above error message for a new .pdf file that is should be synced to my NCPi server (17.0.1)

Another file, a modified .ods spreadsheet also ends up having a red error message in the client, “Error transferring file …”

Here’s an extract from nextcloud.log:
"message":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 242126 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.

These errors occur after the update to 17.0.1 (and NCP 1.19.1)

Edit Dec 12: Errors also in my Android client: “Bad request” for new photo in InstantUpload

1 Like

Checked the Logging section in the web interface after reboot, and the log is filling up with rows like this:

[PHP] Error: curl_exec(): Unable to create temporary file, Check permissions in temporary files directory. at /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php#40

I checked the Nextcloud temp directory permissions, and they look ok:

drwxr-x— 2 www-data www-data 4096 Dec 17 06:25 tmp

Here’s more from the Logging section:

[no app in context] Error: Sabre\DAV\Exception\BadRequest: Expected filesize of 163458 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. at <>

  1. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php line 156
    OCA\DAV\Connector\Sabre\File->put(null)
  2. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1096
    OCA\DAV\Connector\Sabre\Directory->createFile(“IMG-20191213-WA0001.jpg”, null)
  3. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 525
    Sabre\DAV\Server->createFile(“InstantUpload/W … g”, null, null)
  4. <>
    Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Reque … "}, Sabre\HTTP\Response {})
  5. /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},“httpPut”], [Sabre\HTTP\Requ … }])
  6. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit(“method:PUT”, [Sabre\HTTP\Requ … }])
  7. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque … "}, Sabre\HTTP\Response {})
  8. /var/www/nextcloud/apps/dav/appinfo/v1/webdav.php line 80
    Sabre\DAV\Server->exec()
  9. /var/www/nextcloud/remote.php line 163
    undefinedundefinedrequire_once("/var/www/nextcl … p")

PUT /remote.php/webdav/InstantUpload/WhatsApp%20Images/IMG-20191213-WA0001.jpg
from xx.xx.xx.xx by oves at 2019-12-17T21:26:25+00:100:

Hi,

Have you confirmed the tmp path in php.ini?
Please also note the php.ini file in your php-fpm directory.

In our case setting the correct path there fixed this issue (after a php-fpm reload :slight_smile: ).

/etc/php/7.3/fpm/php.ini

In some instances this line:

; Defaults to the system default (see sys_get_temp_dir)
sys_temp_dir = /var/www/nextcloud/data/tmp

Edit to point to your ncdata
commenting out the line works too.

as

; Defaults to the system default (see sys_get_temp_dir)
;sys_temp_dir = “/tmp”

seems to be default

3 Likes

Thank you! Fixed the temp dir path in /etc/php/7.3/fpm/php.ini, rebooted the server, and now my Android and iOS clients synchronize as they should.

However, my Linux Mint laptop has problems: the 2.6.1git client seems to connect but nothing happens, the Activity window is blank.

Logging page (web interface) shows several lines like this:
[PHP] Error: fread(): file created in the system’s temporary directory at /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php#91

PUT /remote.php/webdav/Photos/2019/12/19-12-13%2023-06-36%200001.jpg
from xx.xx.xx.xx by oves at 2019-12-18T12:24:38+00:100:

Should I “reset” the syncing somehow?

Edit: uninstalled Nextcloud-client and removed manually all config and other related files I could find, and then reinstalled. Now it’s resyncing the 31GB of stuff and seems to work as it should.

Thank you @OliverV for the hint with the sys_temp_dir option in /etc/php/7.3/fpm/php.ini

My solution for this is simply creating a symlink to ncdata
# ln -s /media/USBdrive/ncdata /var/www/nextcloud/data

worked for me

Thank You, solved my problem!

Thank You, solved my problem!

NCP [v1.32.1] 20.02 Raspi4 4gb

edit: “/etc/php/7.3/fpm/php.ini”

; Defaults to the system default (see sys_get_temp_dir)
 sys_temp_dir =  /media/USBdrive/ncdata/tmp

A few days ago this issue occured at my NextCloud 20.0.12.1. I could solve it thanks to OliverV (#4). But how can I make sure this issue won’t come again? How is it caused?