Skip to content
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

Unable to upload files #2593

Closed
UTKid opened this issue Aug 1, 2023 · 27 comments
Closed

Unable to upload files #2593

UTKid opened this issue Aug 1, 2023 · 27 comments

Comments

@UTKid
Copy link

UTKid commented Aug 1, 2023

Description

Tried uploading a file on my local network from my computer desktop, but received an "Upload failed: Error: tus: unable to resume upload (new upload cannot be created without an endpoint), originated from request (method: HEAD, url: /api/tus/filename.pdf override=false, response code:405, response text: ,request id:n/a)"

Expected behaviour

I would expect to be able to upload the file without error.

What is happening instead?

A zero byte file is created with the above error message displayed in red.

Additional context

How to reproduce?

Happens every time I try to upload a file starting today, August 1, 2023 after updating File Browser this morning.

Files

@superzjg
Copy link

superzjg commented Aug 1, 2023

screenshot20230801

@StanislavJochman
Copy link

StanislavJochman commented Aug 1, 2023

This issue is currently worked on #2145

@BCalupas
Copy link

BCalupas commented Aug 2, 2023

I see Issue #2145 is merged but issue still persists. Using v2.24.1 with cloudflared

@bauerhunter11
Copy link

bauerhunter11 commented Aug 3, 2023

I am having same issue. Can't upload anything at all because of this issue. Also using cloudflare here. @TobiasGoerke any thoughts?

Using cloudflare the issue happens, but I can successfully upload large files locally.

@TobiasGoerke
Copy link
Contributor

I am having same issue. Can't upload anything at all because of this issue. Also using cloudflare here. @TobiasGoerke any thoughts?

Using cloudflare the issue happens, but I can successfully upload large files locally.

I'll pass this on to @o1egl, who refactored the upload handling in 1769fb1, introducing this bug. I've seen the URL being assembled incorrectly when using a BASE_URL.

I see Issue #2145 is merged but issue still persists. Using v2.24.1 with cloudflared

#2145 was the PR that introduced the issue.

@liljohn360
Copy link

Not sure if this is the same issue, but I'm unable to upload any file either locally or through Cloudflare since updating.

I seem to get a 403:
Upload failed: Error: tus: unexpected response while uploading chunk, originated from request (method: PATCH, url: /api/tus/DasGrain.nk?override=true, response code: 403, response text: 403 Forbidden , request id: n/a)

Running on Raspberry Pi 4B, 64bit Pi OS, tested with Chrome and Firefox

@aureateflux
Copy link

aureateflux commented Aug 5, 2023

Not sure if this is the same issue, but I'm unable to upload any file either locally or through Cloudflare since updating.

I seem to get a 403: Upload failed: Error: tus: unexpected response while uploading chunk, originated from request (method: PATCH, url: /api/tus/DasGrain.nk?override=true, response code: 403, response text: 403 Forbidden , request id: n/a)

Running on Raspberry Pi 4B, 64bit Pi OS, tested with Chrome and Firefox

This appears to be addressed by #2598.

@asad-awadia
Copy link

happening to me too :)

@pcm1ke
Copy link

pcm1ke commented Aug 7, 2023

Happening here too.

@newbthenewbd
Copy link

newbthenewbd commented Aug 9, 2023

Upload failed: Error: tus: unexpected response while uploading chunk, originated from request (method: PATCH, url: /api/tus/Paulkosiarka2.wav?override=true, response code: 403, response text: 403 Forbidden , request id: n/a)

Still happens with v2.24.2 and, apparently, non-admin scoped users with only create, remove, download, edit permissions, whichever might provoke this... Admin uploads work.

Edit: nevermind, edit actually wasn't there (: I thought that's only for the text editor...

@TobiasGoerke
Copy link
Contributor

filebrowser:v2.24.2 works for me

@liljohn360
Copy link

This is still happening as of 2.24.2, uploads either locally or remotely don't work, and give the same error, but only for non admin users

Not sure if this is the same issue, but I'm unable to upload any file either locally or through Cloudflare since updating.

I seem to get a 403: Upload failed: Error: tus: unexpected response while uploading chunk, originated from request (method: PATCH, url: /api/tus/DasGrain.nk?override=true, response code: 403, response text: 403 Forbidden , request id: n/a)

Running on Raspberry Pi 4B, 64bit Pi OS, tested with Chrome and Firefox

@TobiasGoerke
Copy link
Contributor

This is still happening as of 2.24.2, uploads either locally or remotely don't work, and give the same error, but only for non admin users

Not sure if this is the same issue, but I'm unable to upload any file either locally or through Cloudflare since updating.
I seem to get a 403: Upload failed: Error: tus: unexpected response while uploading chunk, originated from request (method: PATCH, url: /api/tus/DasGrain.nk?override=true, response code: 403, response text: 403 Forbidden , request id: n/a)
Running on Raspberry Pi 4B, 64bit Pi OS, tested with Chrome and Firefox

This linne should be responsible. Are you sure your user has all required privileges, like modifying and viewing files?

@liljohn360
Copy link

It appears that guests being unable to edit files is what was causing this, enabling the setting for the guest account appears to fix!

@kimxuantv
Copy link

It appears that guests being unable to edit files is what was causing this, enabling the setting for the guest account appears to fix!

Hello liljohn360, where can i setting? please help.
Thanks

@liljohn360
Copy link

Log into your admin account and go to settings > user management
Click the edit (pen icon) button next to "guest"
Under permissions, make sure "edit files" is checked, and hit save

@kimxuantv
Copy link

Hello,
Please help i can not see the guest
http://171.224.104.204/share/-NBI9FEr
Thanks.

@kimxuantv
Copy link

Hello
I using v2.24.2 unable to upload image files please see the photo in below
http://171.224.104.204/share/7HSkEt1X
Thanks.

@the-hotmann
Copy link

the-hotmann commented Sep 9, 2023

This is my setup:

Cloudflare ==> NPM (Nginx Proxy Manager, in docker) ==> FileBrowser v2.24.2 (in docker)

Yet I get this error:

image

The file I try to upload is about 40MB, my trunk size is set to 80MB. So this actually should not create junks.
Yet I cant upload.

Whatever I upload, log prints:

2023/09/09 14:50:13 /thumb/Zettel/2023/09/test2.png: 500 [###IPv6###] image: unknown format: unsupported image format

I uploaded files that everywhere else work. Some SOOC, also the Filebrowser logo. It does not take it.

Btw: using Cloudflare Enterprise. So trunks will not be needed anyway - yet no option to turn it off. I like trunks, but they seem not to work.

@edurenye
Copy link

edurenye commented Sep 9, 2023

I'm getting the same 405 error also using Cloudflare

@the-hotmann
Copy link

I just saw that in the original Thread (#2145) this already was reported: #2145 (comment)

@TobiasGoerke is there any chance, you might have a look at this?

Thanks in advance!

@TobiasGoerke
Copy link
Contributor

I just saw that in the original Thread (#2145) this already was reported: #2145 (comment)

@TobiasGoerke is there any chance, you might have a look at this?

Thanks in advance!

Cloudflare blocks HEAD requests, thereby causing this issue. IIRC there are some temp fixes listed in on of the issues here.
As a permanent solution, Filebrowser could offer the option to use GET requests that are treated as HEAD requests.
However, I'll pass this on to @o1egl, knowing that he is rather opinionated about these kinds of things.

@o1egl
Copy link
Member

o1egl commented Sep 14, 2023

Please provide the HTTP response information. You can locate it in the network tab of the browser developer console. According to the cloudflare docs, it shouldn't cache responses if Cache-Control is set to no-cache which filebrowser already does.
Alternatively, you can try to disable cloudflare CDN.

@the-hotmann
Copy link

the-hotmann commented Sep 14, 2023

disable cloudflare CDN.

I believe that disabling Cloudflare CDN might not resolve the issue effectively; it would be more of a workaround. Furthermore, I am inclined to retain Cloudflare due to the numerous benefits it offers.

Please provide the HTTP response information. You can locate it in the network tab of the browser developer console.

Thank you for your assistance. Below, you will find the requested HTTP response information:

Here are the pertinent requests:
image

Request 1 (201):

Request URL: https://CENSORED.de/api/tus/Zettel/2023/09/DSC01363.jpg?override=false
Request Method: POST
Status Code: 201 Created
Remote Address: [CENSORED]:443
Referrer Policy: strict-origin-when-cross-origin

Alt-Svc: h3=":443"; ma=86400
Cache-Control: no-cache, no-store, must-revalidate
Cf-Cache-Status: DYNAMIC
Cf-Ray: 806b7f0b1c949b77-FRA
Content-Length: 12
Content-Security-Policy: default-src 'self'; style-src 'unsafe-inline';
Content-Type: text/plain; charset=utf-8
Date: Thu, 14 Sep 2023 20:49:23 GMT
Server: cloudflare
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Served-By: `CENSORED.de`

Request 2 (405):

Request URL: https://CENSORED.de/api/tus/Zettel/2023/09/DSC01363.jpg?override=false
Request Method: HEAD
Status Code: 405 Method Not Allowed
Remote Address: [CENSORED]:443
Referrer Policy: strict-origin-when-cross-origin

Alt-Svc: h3=":443"; ma=86400
Cf-Cache-Status: MISS
Cf-Ray: 806b7f0b6ceb9b77-FRA
Content-Length: 0
Date: Thu, 14 Sep 2023 20:49:23 GMT
Server: cloudflare
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Vary: Accept-Encoding
X-Content-Type-Options: nosniff

As mentioned by @TobiasGoerke, the issue appears to be related to the HEAD request, which Cloudflare does not directly allow on cachable requests. To address this, it may be beneficial to modify the request to use a standard GET request and then extract the header or terminate the request after obtaining the header. Continuing to use HEAD requests will likely result in failure, as Cloudflare converts them to GET requests for cacheable resources. More information on this behavior can be found here.

For those using Cloudflare who are unwilling to wait for a workaround or fix, you can create a Cloudflare PageRule with the following settings:

URL:    your.domain.tld/api/tus/*
Rule:   Cache Level: Bypass

This will allow you to upload immediately, as no cache can be applied to these URLs, and therefore the HEAD request can not be cacheable - ergo: will not be converted to a GET request.

@o1egl o1egl mentioned this issue Sep 14, 2023
@the-hotmann
Copy link

@o1egl thanks!
That fixed the issue. I just removed the PageRule at Cloudflare and it still works!

langren1353 pushed a commit to langren1353/filebrowser-player that referenced this issue Oct 18, 2023
langren1353 pushed a commit to langren1353/filebrowser-player that referenced this issue Oct 18, 2023
langren1353 pushed a commit to langren1353/filebrowser-player that referenced this issue Oct 18, 2023
@megabitsenmzq
Copy link

It appears that guests being unable to edit files is what was causing this, enabling the setting for the guest account appears to fix!

I had this issue today, and enabling "edit" works for me. But I still think "edit" should be a separate permission. I should not need to enable "edit" to let people upload files.

This issue was not presented until I updated filebrowser to the latest version. So this might still be an issue that needs to be addressed.

@m4heshd
Copy link

m4heshd commented Feb 26, 2024

URL:    your.domain.tld/api/tus/*
Rule:   Cache Level: Bypass

Setting this page rule in Cloudflare worked for me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests