Not able to upload files bigger than 8192 Bytes

Nextcloud version : 17.0.1
Operating system : Debian 10 (NextcloudPi)
Apache Version: 2.4.38
PHP version : 7.3.11

The issue you are facing:
After the configuration of my Nextcloud Server I started the initial synchronisation with my PC as the first client device. It successfully uploaded 820 MB, but since then my client always crashes in the uploading phase. In the nextcloud logs, something like the following gets logged:

Expected filesize of 57634 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.

I checked it by uploading files manually over the web interface and indeed, all files with more than 8192 Bytes are denied, while those below are successfully uploaded.
In similar posts like Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 2554891 this problem normally happens with really big files in combination with the apache module mod_reqtimeout. I disabled with the entry

<IfModule reqtimeout_module>
  RequestReadTimeout header=0
  RequestReadTimeout body=0
</IfModule>

in /etc/apache2/apache2.conf . However, this doesn’t solve the problem. Does anyone have an idea?


Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Upload a file bigger than 8 kb via web interface or Nextcloud client

The output of your Nextcloud log in Admin > Logging:

Nextcloud Log
[webdav] Fatal: Sabre\DAV\Exception\BadRequest: Expected filesize of 57634 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 <<closure>>

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

PUT /remote.php/webdav/test.jpg
from 192.168.2.100 by ncp at 2019-12-19T20:46:57+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

config.php
<?php
$CONFIG = array (
  'passwordsalt' => '*hidden*',
  'secret' => '*hidden*',
  'trusted_domains' => 
  array (
   *hidden*
  ),
  'datadirectory' => '/media/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '17.0.1.1',
  'overwrite.cli.url' => '*hidden*',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '*hidden*',
  'dbpassword' => '*hidden*',
  'installed' => true,
  'instanceid' => '*hidden*',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '*hidden*',
  ),
  'tempdirectory' => '/media/nextcloud-data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'logfile' => '/media/nextcloud-data/nextcloud.log',
  'loglevel' => 2,
);

The output of your Apache/nginx/system log in /var/log/____:
There are different log files, and I don’t know which one is useful here. Please tell me if one of them is useful for you.


Thanks for your help!

Edit: Earlier i wrote here, that a version update solved the problem. That was wrong. I did what was written in this post:

Also I commented out sys_temp_dir in /etc/php/7.3/fpm/php.ini, but I am not sure if that was necessary.

1 Like

Also see "HEADERS on invalid stream"
in
/etc/php/7.3/fpm/php.ini
sys_temp_dir
needs to be commented out or point to /path/to/nextcloud/tmp

But likely Nacho fixed this in NCPv1.20.1 / NC17.0.2 :wink:

1 Like

hi scratchin_benni,
I have the EXACT error as yours.
in my apache2.conf
does not even contain:

<IfModule reqtimeout_module>
  RequestReadTimeout header=0
  RequestReadTimeout body=0
</IfModule>

and keep having the issue.
going to see your link reference…

I confirm that, following the link you point out, I solved my uploading issues as well.
Fantastic!
I also resolved the blank app store issue.
Now I see all the apps again.
It seems I resolved all issues at once.
Thanks for your post .

Hi kattivius,
I am happy that all my time and efford I spent for solving this problem also helped you :slight_smile: