nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.32k stars 4.06k forks source link

[Bug]: Badrequest Issue, files fail to upload sometimes #31343

Closed DarkSide1305 closed 1 year ago

DarkSide1305 commented 2 years ago

⚠️ This issue respects the following points: ⚠️

Bug description

When uploading files they sometimes error out, giving me a Badrequest error, the file failing to upload.

Steps to reproduce

  1. Upload a lot of files

Expected behavior

All files should be uploaded correctly

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

PHP 7.4

Web server

Nginx

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

(Sadly cant look it up, error: OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?))

List of activated Apps

Enabled:
Accessibility, Activity, Breeze Dark, Brute-force settings, Calendar, Circles, Collaborative tags, Comments, Contacts, Contacts Interaction, Dashboard, Deleted files, Federation, File sharing, First run wizard, Log Reader, Mail, Monitoring, Nextcloud announcements, Nextcloud Office, Notifications,  Password policy, PDF viewer, Photos, Privacy, Recommendations, Right click, Share by mail, Support, Talk, Text, Theming, Update notification, Usage survey, User status, Versions, Video player, Weather status, 
Disabled: Auditing / Logging, Default encryption module, External storage support, LDAP user and group backend

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"<Req ID>",
"level":3,
"time":"2022-02-23T17:56:25+00:00",
"remoteAddr":"<My IP Adress>",
"user":"DarkSide1305",
"app":"no app in context",
"method":"PUT",
"url":"/remote.php/webdav/<Folder 1>/<Sub Folder 1>/<Picture>.jpg",
"message":"Expected filesize of 539021 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 532480 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.",
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0",
"version":"23.0.2.1",
"exception":{"Exception":"Sabre\\DAV\\Exception\\BadRequest",
"Message":"Expected filesize of 539021 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 532480 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.",
"Code":0,
"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
"line":155,
"function":"put",
"class":"OCA\\DAV\\Connector\\Sabre\\File",
"type":"->"},
{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line":1098,
"function":"createFile",
"class":"OCA\\DAV\\Connector\\Sabre\\Directory",
"type":"->"},
{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line":504,
"function":"createFile",
"class":"Sabre\\DAV\\Server",
"type":"->"},
{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line":89,
"function":"httpPut",
"class":"Sabre\\DAV\\CorePlugin",
"type":"->"},
{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line":472,
"function":"emit",
"class":"Sabre\\DAV\\Server",
"type":"->"},
{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line":253,
"function":"invokeMethod",
"class":"Sabre\\DAV\\Server",
"type":"->"},
{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line":321,
"function":"start",
"class":"Sabre\\DAV\\Server",
"type":"->"},
{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php",
"line":83,
"function":"exec",
"class":"Sabre\\DAV\\Server",
"type":"->"},
{"file":"/var/www/nextcloud/remote.php",
"line":166,
"args":["/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],
"function":"require_once"}],
"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
"Line":245,"CustomMessage":"--"}}

Additional info

I know that this error has been posted many times on Github already, but every single one I found
so far had no solution, thats why im posting this one. My Nginx Log has nothing.
DarkSide1305 commented 2 years ago

The issue is fixed - HTTP/2 is the problem. For some reason Nextcloud and Nginx cant handle HTTP/2. My Website is barely slower, uploads are up to 3x faster, and after 1k+ files they didnt bug out. EDIT: Gonna leave this issue up - seems like nothing that should have to be disabled for things to not bug out (I have changed absolutely nothing else but turn off HTTP/2, so im 100% certain thats the cause)

solracsf commented 1 year ago

Duplicate of https://github.com/nextcloud/server/issues/31343 FYI HTTP2 is disabled on my side (was never enabled) and problem stills (also for other users on that topic).