Can't upload image/files - 403 response #5252

Closed
opened 2026-02-05 09:51:29 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @Pretender2064 on GitHub (Apr 7, 2025).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I have Bookstack installed through the Linuxserver.io docker image.
I have a user who tried to upload images to a page and keeps getting an error code which appears to be some HTML code, but doesn't display anything when I put it into a HTML file. Screenshot below:

Image

I found that this was a 403 error from the post request, I then checked the permissions of the volume on the host system and folders inside the docker container and both shouldn't have caused any issues. To eliminate one thing, I tried doing chmod 777 on the folders, but this did not solve the issue.

I tried looking at the larvel.log file, but it has not been written to for about a month. This could be related?
However, the nginx access logs are updated with each action as expected.

I tried enabling app_debug, but this didn't do anything as far as I can see and also did not start logging in any log files.

As I don't have any errors in the log file to investigate, I'm at a loss on what could be causing this.

Exact BookStack Version

25.02

Log Content

Nothing is written to the log file as described above.

Hosting Environment

Docker 28.0.1 running on Ubuntu 24.04.2 LTS.
Cloudflare tunnel running for reverse proxy.
Other containers running on the server aren't affected by this issue.

Originally created by @Pretender2064 on GitHub (Apr 7, 2025). ### Attempted Debugging - [x] I have read the debugging page ### Searched GitHub Issues - [x] I have searched GitHub for the issue. ### Describe the Scenario I have Bookstack installed through the Linuxserver.io docker image. I have a user who tried to upload images to a page and keeps getting an error code which appears to be some HTML code, but doesn't display anything when I put it into a HTML file. Screenshot below: ![Image](https://github.com/user-attachments/assets/92a1e0f5-6d99-4777-8382-0e48797e484c) I found that this was a 403 error from the post request, I then checked the permissions of the volume on the host system and folders inside the docker container and both shouldn't have caused any issues. To eliminate one thing, I tried doing chmod 777 on the folders, but this did not solve the issue. I tried looking at the larvel.log file, but it has not been written to for about a month. This could be related? However, the nginx access logs are updated with each action as expected. I tried enabling app_debug, but this didn't do anything as far as I can see and also did not start logging in any log files. As I don't have any errors in the log file to investigate, I'm at a loss on what could be causing this. ### Exact BookStack Version 25.02 ### Log Content Nothing is written to the log file as described above. ### Hosting Environment Docker 28.0.1 running on Ubuntu 24.04.2 LTS. Cloudflare tunnel running for reverse proxy. Other containers running on the server aren't affected by this issue.
OVERLORD added the 🐕 Support label 2026-02-05 09:51:29 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Apr 7, 2025):

Hi @Pretender2064,

I have a user who tried to upload images to a page and keeps getting an error code which appears to be some HTML code

  • Is it just that user which has the issue? Or can it be replicated by you too?
  • Do other images upload okay?

However, the nginx access logs are updated with each action as expected.

  • Do the logged lines reflect the 403 response too?
  • Is this the nginx logs provided by the linuxserver bookstack image? Or some other nginx proxy/layer in play?

but doesn't display anything when I put it into a HTML file.

If possible, it would be good if you could share that HTML code, as that could help indicate which layer is returning the response.

@ssddanbrown commented on GitHub (Apr 7, 2025): Hi @Pretender2064, > I have a user who tried to upload images to a page and keeps getting an error code which appears to be some HTML code - Is it just that user which has the issue? Or can it be replicated by you too? - Do other images upload okay? > However, the nginx access logs are updated with each action as expected. - Do the logged lines reflect the 403 response too? - Is this the nginx logs provided by the linuxserver bookstack image? Or some other nginx proxy/layer in play? > but doesn't display anything when I put it into a HTML file. If possible, it would be good if you could share that HTML code, as that could help indicate which layer is returning the response.
Author
Owner

@Pretender2064 commented on GitHub (Apr 8, 2025):

Thanks for getting back to me so quickly @ssddanbrown!

I'm also unable to upload photos and documents (as the admin user if that makes a difference).

No, the nginx access logs don't have any 403s, only 200s and 302s.
These are the nginx logs on the bookstack image. I haven't added anything other than the Cloudflare tunnel for access.

HTML error attached here (as a txt file): BookstackError.txt

@Pretender2064 commented on GitHub (Apr 8, 2025): Thanks for getting back to me so quickly @ssddanbrown! I'm also unable to upload photos and documents (as the admin user if that makes a difference). No, the nginx access logs don't have any 403s, only 200s and 302s. These are the nginx logs on the bookstack image. I haven't added anything other than the Cloudflare tunnel for access. HTML error attached here (as a txt file): [BookstackError.txt](https://github.com/user-attachments/files/19645127/BookstackError.txt)
Author
Owner

@ssddanbrown commented on GitHub (Apr 8, 2025):

Thanks for the info @Pretender2064,

Based on the provided HTML, I'm fairly confident that's a Cloudflare challenge (Used to prevent bots & limit attacks etc...).
Therefore I don't think these requests are reaching BookStack at all, but getting blocked by cloudflare along the way.

I'm not really sure why Cloudflare is blocking these.
It might be worth checking in cloudflare for any logs which report events to see if they provide any clues.
Otherwise, if Cloudflare provides levels of security control for the tunnel, it might be worth temporarily turning down security controls to see if that helps.

@ssddanbrown commented on GitHub (Apr 8, 2025): Thanks for the info @Pretender2064, Based on the provided HTML, I'm fairly confident that's a Cloudflare challenge (Used to prevent bots & limit attacks etc...). Therefore I don't think these requests are reaching BookStack at all, but getting blocked by cloudflare along the way. I'm not really sure why Cloudflare is blocking these. It might be worth checking in cloudflare for any logs which report events to see if they provide any clues. Otherwise, if Cloudflare provides levels of security control for the tunnel, it might be worth temporarily turning down security controls to see if that helps.
Author
Owner

@Pretender2064 commented on GitHub (Apr 8, 2025):

That is it! Thanks for the help.

I have a few similar errors on my cloudflare logs:
ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: read tcp 127.0.0.1:42604->127.0.0.1:6875: read: connection reset by peer"

Now just need to figure out why. Thank you again!

@Pretender2064 commented on GitHub (Apr 8, 2025): That is it! Thanks for the help. I have a few similar errors on my cloudflare logs: `ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: read tcp 127.0.0.1:42604->127.0.0.1:6875: read: connection reset by peer"` Now just need to figure out why. Thank you again!
Author
Owner

@ssddanbrown commented on GitHub (Apr 8, 2025):

Just to help you avoid getting side-tracked, I'd think that specific error message would be unrelated to the user image issue.
That log message probably from connection breaks/resets, which I'd expect to present differently (as an error), not as a user challenge.

@ssddanbrown commented on GitHub (Apr 8, 2025): Just to help you avoid getting side-tracked, I'd think that specific error message would be unrelated to the user image issue. That log message probably from connection breaks/resets, which I'd expect to present differently (as an error), not as a user challenge.
Author
Owner

@Pretender2064 commented on GitHub (Apr 8, 2025):

Perfect - that is very useful. I'm just looking into the connection settings now.
Thanks for all your help. I'll close this now as it isn't a bookstack issue.

@Pretender2064 commented on GitHub (Apr 8, 2025): Perfect - that is very useful. I'm just looking into the connection settings now. Thanks for all your help. I'll close this now as it isn't a bookstack issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5252