Getting error 400 after a being disconnected for a while

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2):
Operating system and version (eg, Ubuntu 20.04):
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:
I get error while trying connecting from an external domain, but only after there is no one connected to the website and after a while. To make it accessible again I have to connect with local ip address and then the domain starts working again.

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

Steps to replicate it:

  1. disconnect from website
  2. wait a while
  3. try to connect from external ip or domain

The output of your Nextcloud log in Admin > Logging:

Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:36+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:36+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:36+0100
Fatal	webdav	Sabre\DAV\Exception: Could not rename part file to final file	
2020-12-16T15:25:36+0100
Error	webdav	renaming part file to final file failed $renameOkay: false, $fileExists: false)	
2020-12-16T15:25:36+0100
Error	core	unable to rename, source directory is not writable : uploads/web-file-upload-c98bc7f0f88b247c702cce60ee3307a6-1608128675433	
2020-12-16T15:25:36+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:35+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:35+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:35+0100
Fatal	webdav	Sabre\DAV\Exception: Could not rename part file to final file	
2020-12-16T15:25:35+0100
Error	webdav	renaming part file to final file failed $renameOkay: false, $fileExists: false)	
2020-12-16T15:25:35+0100
Error	core	unable to rename, source directory is not writable : uploads/web-file-upload-10218b8a17d2fa517b32c5058e053e74-1608128675434	
2020-12-16T15:25:35+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:30+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:30+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:30+0100
Fatal	webdav	Sabre\DAV\Exception: Could not rename part file to final file	
2020-12-16T15:25:30+0100
Error	webdav	renaming part file to final file failed $renameOkay: false, $fileExists: false)	
2020-12-16T15:25:30+0100
Error	core	unable to rename, source directory is not writable : uploads/web-file-upload-a5f87a6957d6f8108f6b6978498b8390-1608128675427	
2020-12-16T15:25:30+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:29+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:29+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:25:29+0100
Fatal	webdav	Sabre\DAV\Exception: Could not rename part file to final file	
2020-12-16T15:25:29+0100
Error	webdav	renaming part file to final file failed $renameOkay: false, $fileExists: false)	
2020-12-16T15:25:29+0100
Error	core	unable to rename, source directory is not writable : uploads/web-file-upload-dc8adb28594c9e865388c422dee441dc-1608128675432	
2020-12-16T15:25:29+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:24:47+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:24:47+0100
Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691	
2020-12-16T15:24:47+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 7816395 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 4947968 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	

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

PASTE HERE
<?php
$CONFIG = array (
  'instanceid' => 'ocs8df9n9ty9',
  'passwordsalt' => '+',
  'secret' => '+',
  'trusted_domains' => 
  array (
    0 => 'xx.xx.xx.xx',
    1 => '192.168.1.54',
    2 => 'my.domain',
  ),
  'datadirectory' => '/var/nextdata/data',
  'dbtype' => 'sqlite3',
  'version' => '20.0.4.0',
  'overwrite.cli.url' => 'http://my.domain/nextcloud',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '25',
  'mail_from_address' => 'my.domain',
  'mail_domain' => 'gmail.com',
  'mail_smtpname' => 'xxxx@xxxx.xxx',
  'mail_smtppassword' => 'xxxx',
  'mail_smtpsecure' => 'tls',
  'log_type' => 'errorlog',
  'maintenance' => false,
);



The output of your Apache/nginx/system log in `/var/log/____`:

[Fri Dec 18 00:00:08.298665 2020] [ssl:warn] [pid 684] AH01906: 127.0.1.1:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Dec 18 00:00:08.298791 2020] [ssl:warn] [pid 684] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Fri Dec 18 00:00:08.299266 2020] [mpm_prefork:notice] [pid 684] AH00163: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured – resuming normal operations
[Fri Dec 18 00:00:08.299289 2020] [core:notice] [pid 684] AH00094: Command line: ‘/usr/sbin/apache2’
[Fri Dec 18 07:19:07.151937 2020] [php7:notice] [pid 3101] [client 93.xx.xx.xx:38692] [owncloud][index][3] {“Exception”:“Exception”,“Message”:"Return value of$
[Fri Dec 18 07:45:50.982775 2020] [php7:notice] [pid 5485] [client 151.28.211.114:36100] [owncloud][PHP][3] {“Exception”:“Error”,“Message”:"Illegal string offse$
[Fri Dec 18 07:46:16.449973 2020] [php7:notice] [pid 5504] [client 151.28.211.114:36120] [owncloud][PHP][3] {“Exception”:“Error”,“Message”:"Illegal string offse$
[Fri Dec 18 07:51:57.505284 2020] [php7:notice] [pid 5484] [client 93.xx.xx.xx:38960] [owncloud][index][3] {“Exception”:“Exception”,“Message”:"Return value of$
cat: /sys/class/net/wlan0/speed: Invalid argument
cat: /sys/class/net/wlan0/duplex: Invalid argument
[Fri Dec 18 08:37:16.783411 2020] [php7:notice] [pid 5504] [client 192.168.1.55:34516] [owncloud][index][3] {“Exception”:“Exception”,“Message”:"Return value of $
[Fri Dec 18 08:43:23.289965 2020] [php7:notice] [pid 5644] [client xx.xx.xx.xx:40366] [owncloud][index][3] {“Exception”:“Exception”,“Message”:"Return value of$
cat: /sys/class/net/wlan0/speed: Invalid argument
cat: /sys/class/net/wlan0/duplex: Invalid argument
[Fri Dec 18 08:53:15.660519 2020] [mpm_prefork:notice] [pid 684] AH00169: caught SIGTERM, shutting down
[Fri Dec 18 08:53:34.452319 2020] [ssl:warn] [pid 636] AH01906: 127.0.1.1:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Dec 18 08:53:34.460809 2020] [ssl:warn] [pid 636] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Fri Dec 18 08:53:36.046624 2020] [ssl:warn] [pid 683] AH01906: 127.0.1.1:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Dec 18 08:53:36.046740 2020] [ssl:warn] [pid 683] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Fri Dec 18 08:53:36.094434 2020] [mpm_prefork:notice] [pid 683] AH00163: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured – resuming normal operations
[Fri Dec 18 08:53:36.094605 2020] [core:notice] [pid 683] AH00094: Command line: ‘/usr/sbin/apache2’
cat: /sys/class/net/wlan0/speed: Invalid argument
cat: /sys/class/net/wlan0/duplex: Invalid argument
cat: /sys/class/net/wlan0/speed: Invalid argument
cat: /sys/class/net/wlan0/duplex: Invalid argument
[Fri Dec 18 09:12:49.795091 2020] [php7:notice] [pid 2610] [client xx.xx.xx.xx:41032] [owncloud][index][3] {“Exception”:“Exception”,“Message”:"Return value of$
[Fri Dec 18 09:32:05.720396 2020] [php7:notice] [pid 2611] [client xx.xx.xx.xx:41104] [owncloud][index][3] {“Exception”:“Exception”,“Message”:"Return value of$
[Fri Dec 18 10:39:12.244659 2020] [php7:notice] [pid 2721] [client 192.168.1.55:35900] [owncloud][index][3] {“Exception”:“Exception”,“Message”:"Return value of $
cat: /sys/class/net/wlan0/speed: Invalid argument
cat: /sys/class/net/wlan0/duplex: Invalid argument
cat: /sys/class/net/wlan0/speed: Invalid argument
cat: /sys/class/net/wlan0/duplex: Invalid argument
[Fri Dec 18 11:04:14.860547 2020] [php7:notice] [pid 755] [client 192.168.1.55:37052] [owncloud][index][3] {“Exception”:“Exception”,“Message”:"Return value of O$