-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dav: Fix handling of chunked WebDAV upload #13871
Conversation
When $data is null (which can happen when $request->getBodyAsStream() returns null), the Exceptions says "copied bytes: 0, expected filesize: 0", which sounds more like success...
Just to summarize: this can be triggered by uploading an empty file? |
@MorrisJobke No. The PDF uploaded by the scanner definitely isn't empty, and on the other hand uploading an empty TXT via gvfs didn't trigger the bug. I guess the scanner just starts with an empty body in the first request of a chunked transfer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes it for me. I triggered the bug by running touch to create an empty file and make the nextcloud desktop client sync it. I get http 500 without this fix.
@MorrisJobke You are right. I triggered this bug by syncing an empty file with the desktop client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code makes sense 👍
Status of 15220: failure
Show full log
|
Failure is unrelated. |
/backport to stable15 |
backport to stable15 in #14517 |
When
$data
is null (which can happen when$request->getBodyAsStream()
returnsnull
), the Exceptions says "copied bytes: 0, expected filesize: 0", which sounds more like success... So treat it as such!This regression (it worked in Nextcloud 14) was probably introduced by commit 93de637
The setup resulting in this situation was a Canon iR-ADV C5030 uploading its scans via WebDAV to an SFTP external storage. Here is the error that resulted in an HTTP Error 500 being returned:
Nextcloud log (data/nextcloud.log)
Nextcloud log