NC15 failed upload file

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, 15.0.2):
Operating system and version (eg, Centos 7):
Apache or nginx version (eg, nginx 1.12.2):
PHP version (eg, 7.2.14):

The issue you are facing:

When upload a file, an “unknown error” crashes and the upload stops.

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

Steps to replicate it:

  1. Upload file to nextcloud

The output of your Nextcloud log in Admin > Logging:

[webdav] Fatal: Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 6832128 at <<closure>>

 0. /usr/share/nginx/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php line 156
    put(null)
 1. /usr/share/nginx/html/nextcloud/apps/dav/lib/Upload/UploadFolder.php line 39
    createFile("4613734400", null)
 2. /usr/share/nginx/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1096
    createFile("4613734400", null)
 3. /usr/share/nginx/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 525
    createFile("uploads/n.gamzi ... 0", null, null)
 4. <<closure>>
    httpPut(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 5. /usr/share/nginx/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpPut"], [Sabre\HTTP\Requ ... }])
 6. /usr/share/nginx/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:PUT", [Sabre\HTTP\Requ ... }])
 7. /usr/share/nginx/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 8. /usr/share/nginx/html/nextcloud/apps/dav/lib/Server.php line 301
    exec()
 9. /usr/share/nginx/html/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    exec()
10. /usr/share/nginx/html/nextcloud/remote.php line 163
    require_once("/usr/share/ngin ... p")

PUT /remote.php/dav/uploads/n.gamzin/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548930423777/4613734400
from 172.16.11.161 by n.gamzin at 2019-01-31T13:31:32+03:00

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

<?php
$CONFIG = array (
  'instanceid' => 'ocrpnh0b5l00',
  'passwordsalt' => 'XXXXXX',
  'secret' => 'XXXXX',
  'trusted_domains' => 
  array (
    0 => 'ncloud.dssl.ru',
    1 => 'onlyoffice.dssl.ru',
  ),
  'datadirectory' => '/usr/share/nginx/html/nextcloud/data',
  'overwrite.cli.url' => 'https://ncloud.dssl.ru',
  'lost_password_link' => 'http://rpwd.dssl.local/index.php?action=sendtoken',
  'dbtype' => 'pgsql',
  'version' => '15.0.2.0',
  'dbname' => 'nextcloud',
  'dbhost' => '127.0.0.1',
  'dbport' => '5432',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'XXXXX',
  'dbpassword' => 'XXXXXXXX',
  'installed' => true,
  'trashbin_retention_obligation' => '90, 120',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'ldapUserCleanupInterval' => 15,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => '3',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpsecure' => 'tls',
  'updater.release.channel' => 'stable',
  'allow_user_to_change_display_name' => true,
  'remember_login_cookie_lifetime' => 1296000,
  'cache_path' => '/nextcloud',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'mail.dssl.ru',
  'mail_smtphost' => 'mail.dssl.ru',
  'mail_smtpport' => '25',
  'logtimezone' => '+3',
  'logfile' => '/var/log/nextcloud.log',
  'updater.secret' => '$2y$10$N21B/MoyUa06GG5BfjhvKuNO/vY36tPmXaIPeEOq89h5/F/lh430i',
);

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


{
	"reqId": "wPnlhba60mVQfkYJvDcB",
	"level": 3,
	"time": "2019-01-31T12:19:31+03:00",
	"remoteAddr": "172.16.11.161",
	"user": "n.gamzin",
	"app": "PHP",
	"method": "PUT",
	"url": "\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3323985920",
	"message": "Object of class OC\\AppFramework\\Http\\Request could not be converted to string at \/usr\/share\/nginx\/html\/nextcloud\/remote.php#125",
	"userAgent": "Mozilla\/5.0 (X11; Fedora; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36",
	"version": "15.0.2.0"
} {
	"reqId": "wPnlhba60mVQfkYJvDcB",
	"level": 3,
	"time": "2019-01-31T12:19:31+03:00",
	"remoteAddr": "172.16.11.161",
	"user": "n.gamzin",
	"app": "PHP",
	"method": "PUT",
	"url": "\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3323985920",
	"message": "file_put_contents(): file created in the system's temporary directory at \/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#467",
	"userAgent": "Mozilla\/5.0 (X11; Fedora; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36",
	"version": "15.0.2.0"
} {
	"reqId": "5ZKl1Izc8wGv5XYR5Bwl",
	"level": 3,
	"time": "2019-01-31T12:19:32+03:00",
	"remoteAddr": "172.16.11.161",
	"user": "n.gamzin",
	"app": "PHP",
	"method": "PUT",
	"url": "\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
	"message": "Object of class OC\\AppFramework\\Http\\Request could not be converted to string at \/usr\/share\/nginx\/html\/nextcloud\/remote.php#125",
	"userAgent": "Mozilla\/5.0 (X11; Fedora; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36",
	"version": "15.0.2.0"
} {
	"reqId": "5ZKl1Izc8wGv5XYR5Bwl",
	"level": 3,
	"time": "2019-01-31T12:19:32+03:00",
	"remoteAddr": "172.16.11.161",
	"user": "n.gamzin",
	"app": "PHP",
	"method": "PUT",
	"url": "\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
	"message": "file_put_contents(): file created in the system's temporary directory at \/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#467",
	"userAgent": "Mozilla\/5.0 (X11; Fedora; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36",
	"version": "15.0.2.0"
} {
	"reqId": "5ZKl1Izc8wGv5XYR5Bwl",
	"level": 3,
	"time": "2019-01-31T12:19:32+03:00",
	"remoteAddr": "172.16.11.161",
	"user": "n.gamzin",
	"app": "no app in context",
	"method": "PUT",
	"url": "\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
	"message": {
		"Exception": "Sabre\\DAV\\Exception\\BadRequest",
		"Message": "expected filesize 10485760 got 1867776",
		"Code": 0,
		"Trace": [{
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php",
			"line": 156,
			"function": "put",
			"class": "OCA\\DAV\\Connector\\Sabre\\File",
			"type": "->",
			"args": [null]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/lib\/Upload\/UploadFolder.php",
			"line": 39,
			"function": "createFile",
			"class": "OCA\\DAV\\Connector\\Sabre\\Directory",
			"type": "->",
			"args": ["3334471680", null]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php",
			"line": 1096,
			"function": "createFile",
			"class": "OCA\\DAV\\Upload\\UploadFolder",
			"type": "->",
			"args": ["3334471680", null]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php",
			"line": 525,
			"function": "createFile",
			"class": "Sabre\\DAV\\Server",
			"type": "->",
			"args": ["uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680", null, null]
		}, {
			"function": "httpPut",
			"class": "Sabre\\DAV\\CorePlugin",
			"type": "->",
			"args": [{
				"absoluteUrl": "https:\/\/ncloud.dssl.ru\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
				"__class__": "Sabre\\HTTP\\Request"
			}, {
				"__class__": "Sabre\\HTTP\\Response"
			}]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php",
			"line": 105,
			"function": "call_user_func_array",
			"args": [
				[{
					"__class__": "Sabre\\DAV\\CorePlugin"
				}, "httpPut"],
				[{
					"absoluteUrl": "https:\/\/ncloud.dssl.ru\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
					"__class__": "Sabre\\HTTP\\Request"
				}, {
					"__class__": "Sabre\\HTTP\\Response"
				}]
			]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php",
			"line": 479,
			"function": "emit",
			"class": "Sabre\\Event\\EventEmitter",
			"type": "->",
			"args": ["method:PUT", [{
				"absoluteUrl": "https:\/\/ncloud.dssl.ru\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
				"__class__": "Sabre\\HTTP\\Request"
			}, {
				"__class__": "Sabre\\HTTP\\Response"
			}]]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php",
			"line": 254,
			"function": "invokeMethod",
			"class": "Sabre\\DAV\\Server",
			"type": "->",
			"args": [{
				"absoluteUrl": "https:\/\/ncloud.dssl.ru\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
				"__class__": "Sabre\\HTTP\\Request"
			}, {
				"__class__": "Sabre\\HTTP\\Response"
			}]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/lib\/Server.php",
			"line": 301,
			"function": "exec",
			"class": "Sabre\\DAV\\Server",
			"type": "->",
			"args": []
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php",
			"line": 35,
			"function": "exec",
			"class": "OCA\\DAV\\Server",
			"type": "->",
			"args": []
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/remote.php",
			"line": 164,
			"args": ["\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php"],
			"function": "require_once"
		}],
		"File": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php",
		"Line": 200,
		"CustomMessage": "--"
	},
	"userAgent": "Mozilla\/5.0 (X11; Fedora; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36",
	"version": "15.0.2.0"
} {
	"reqId": "5ZKl1Izc8wGv5XYR5Bwl",
	"level": 4,
	"time": "2019-01-31T12:19:32+03:00",
	"remoteAddr": "172.16.11.161",
	"user": "n.gamzin",
	"app": "webdav",
	"method": "PUT",
	"url": "\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
	"message": {
		"Exception": "Sabre\\DAV\\Exception\\BadRequest",
		"Message": "expected filesize 10485760 got 1867776",
		"Code": 0,
		"Trace": [{
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php",
			"line": 156,
			"function": "put",
			"class": "OCA\\DAV\\Connector\\Sabre\\File",
			"type": "->",
			"args": [null]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/lib\/Upload\/UploadFolder.php",
			"line": 39,
			"function": "createFile",
			"class": "OCA\\DAV\\Connector\\Sabre\\Directory",
			"type": "->",
			"args": ["3334471680", null]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php",
			"line": 1096,
			"function": "createFile",
			"class": "OCA\\DAV\\Upload\\UploadFolder",
			"type": "->",
			"args": ["3334471680", null]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php",
			"line": 525,
			"function": "createFile",
			"class": "Sabre\\DAV\\Server",
			"type": "->",
			"args": ["uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680", null, null]
		}, {
			"function": "httpPut",
			"class": "Sabre\\DAV\\CorePlugin",
			"type": "->",
			"args": [{
				"absoluteUrl": "https:\/\/ncloud.dssl.ru\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
				"__class__": "Sabre\\HTTP\\Request"
			}, {
				"__class__": "Sabre\\HTTP\\Response"
			}]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php",
			"line": 105,
			"function": "call_user_func_array",
			"args": [
				[{
					"__class__": "Sabre\\DAV\\CorePlugin"
				}, "httpPut"],
				[{
					"absoluteUrl": "https:\/\/ncloud.dssl.ru\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
					"__class__": "Sabre\\HTTP\\Request"
				}, {
					"__class__": "Sabre\\HTTP\\Response"
				}]
			]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php",
			"line": 479,
			"function": "emit",
			"class": "Sabre\\Event\\EventEmitter",
			"type": "->",
			"args": ["method:PUT", [{
				"absoluteUrl": "https:\/\/ncloud.dssl.ru\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
				"__class__": "Sabre\\HTTP\\Request"
			}, {
				"__class__": "Sabre\\HTTP\\Response"
			}]]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php",
			"line": 254,
			"function": "invokeMethod",
			"class": "Sabre\\DAV\\Server",
			"type": "->",
			"args": [{
				"absoluteUrl": "https:\/\/ncloud.dssl.ru\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260\/3334471680",
				"__class__": "Sabre\\HTTP\\Request"
			}, {
				"__class__": "Sabre\\HTTP\\Response"
			}]
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/lib\/Server.php",
			"line": 301,
			"function": "exec",
			"class": "Sabre\\DAV\\Server",
			"type": "->",
			"args": []
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php",
			"line": 35,
			"function": "exec",
			"class": "OCA\\DAV\\Server",
			"type": "->",
			"args": []
		}, {
			"file": "\/usr\/share\/nginx\/html\/nextcloud\/remote.php",
			"line": 164,
			"args": ["\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php"],
			"function": "require_once"
		}],
		"File": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php",
		"Line": 200,
		"CustomMessage": "--"
	},
	"userAgent": "Mozilla\/5.0 (X11; Fedora; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36",
	"version": "15.0.2.0"
} {
	"reqId": "VY2PXCX3f8oiBp3aX9e9",
	"level": 3,
	"time": "2019-01-31T12:19:32+03:00",
	"remoteAddr": "172.16.11.161",
	"user": "n.gamzin",
	"app": "PHP",
	"method": "DELETE",
	"url": "\/remote.php\/dav\/uploads\/n.gamzin\/web-file-upload-eb3d8ffa30f02708375177b00a6cc743-1548926138260",
	"message": "Object of class OC\\AppFramework\\Http\\Request could not be converted to string at \/usr\/share\/nginx\/html\/nextcloud\/remote.php#125",
	"userAgent": "Mozilla\/5.0 (X11; Fedora; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/66.0.3359.181 Safari\/537.36",
	"version": "15.0.2.0"
}