[SOLVED] Client timeout when pushing files to NC

Nextcloud version (eg, 10.0.2): 11.0.1
Operating system and version (eg, Ubuntu 16.04): Debian 8.7
Apache or nginx version (eg, Apache 2.4.25): 2.4.10
PHP version (eg, 5.6): 5.6.29
Is this the first time you’ve seen this error and can you replicate it?: Yes first time and every PUT same issue

The issue you are facing:

When adding a file via the client, the client states it sent the file, but stalls. After about 5 min it results in a timeout. It then shows in the apache log as a PUT with code 404. When checking the actual server (via web portal) the file does exists. After the second sync process of the client it clears.

The output of your Nextcloud log in Admin > Logging:
No Log output during that time

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

<?php
$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '***,
  'secret' => '***,
  'trusted_domains' =>
  array (
    0 => '192.168.7.241',
  ),
  'datadirectory' => '/media/nextcloud',
  'overwrite.cli.url' => 'https://cloud.<domain>.uk',
  'dbtype' => 'mysql',
  'version' => '11.0.1.2',
  'dbname' => 'nextcloud',
  'dbhost' => '192.168.7.244',
  'dbtableprefix' => 'nc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '***,
  'logtimezone' => 'UTC',
  'installed' => true,
  'trusted_proxies' =>
  array (
    0 => '192.168.7.241',
  ),
  'overwritehost' => 'cloud.domain.uk',
  'overwriteprotocol' => 'https',
  'overwritewebroot' => '/',
  'overwritecondaddr' => '^192\\.168\\.7\\.241$',
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'sendmail',
  'mail_domain' => '<domain>.uk',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'maintenance' => false,
  'log_type' => 'owncloud',
  'logfile' => '/var/log/nextcloud.log',
  'loglevel' => '2',
  'log_rotate_size' => '104857600',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mail.<domain>.net',
  'mail_smtpport' => '25',
  'mail_smtpname' => 'admin',
  'mail_smtppassword' => '***',
  'htaccess.RewriteBase' => '/',
  'updater.server.url' => 'https://updates.nextcloud.org/updater_server/',
  'filesystem_check_changes' => 1,
  'enable_previews' => true,
  'preview_max_x' => 640,
  'preview_max_y' => 640,
  'skeletondirectory' => '/media/nextcloud/skeleton',
  'appstore.experimental.enabled' => true,
  'activity_expire_days' => 365,
);

The output of your Apache/nginx/system log in /var/log/apache2/access.log:

192.168.7.1 - - [24/Jan/2017:18:48:02 +0000] "PUT /remote.php/webdav/Documents/Calendar%202017%20-%20Copy.ods HTTP/1.1" 404 963 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 2) (Nextcloud)"


OK I fixed it. Made a mistake on my side.

I had put the maximum upload file size to 16GB (bit more than I wanted) which caused PHP to hang. Changing it to a more acceptable value (4GB) in Admin -> Additional settings -> File handling it worked as a charm :slight_smile:

After some more digging, since the issue came back again I found it is linked to a bug already reported. It seems when plenty of filecache entries are in the database PHP will use lots of memory causing it to time out.

Changing the memory_limit to 1G in .htaccess works as a workaround.