mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-08 03:09:39 +03:00
Unable to upload images to self hosted Minio S3 service #4894
Closed
opened 2026-02-05 09:24:14 +03:00 by OVERLORD
·
7 comments
No Branch/Tag Specified
development
further_theme_development
l10n_development
release
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🐕 Support
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#4894
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Rami-Pastrami on GitHub (Jul 31, 2024).
Attempted Debugging
Searched GitHub Issues
Describe the Scenario
I am trying to enable S3 image uploading to a private Minio instance, however every time I attempt to upload an image, I get an HTTP 500 error from book stack as well as an error fly-in on the top right stating that "An error occurred uploading the image"
In Debug mode, I caught the HTTP 500 error in the web console (which also appears out of debug mode but with less details). The full details from debug mode are:
League\Flysystem\UnableToCheckFileExistence
Unable to check existence for: uploads/images/gallery/2024-07/image.png
Stack trace (I believe this is the same as in the larvel log but including anyways)
Details
This seems almost like an authentication issue?

I can see in the Minio logs the following:
In other words, I see a GetObject twice, I dont see any mention of files being uploaded (checking the bucket contents also show it to be empty).
I double checked that the authorized keys / credentials are valid for this bucket, and I have other software that uses this minio s3 instance on other buckets that work fine. I even tried setting the bucket read/write permissions to public (meaning no auth needed to read or write to the entire bucket, which obviously isnt a proper solution but even this did not work.
Uploading files directly/manually to the bucket via the minio Web GUI and then pulling them from the domain externally as a direct link works fine on this public setting
I configured the .env file as per the documentation for non-amazon s3
https://www.bookstackapp.com/docs/admin/upload-config/
I found a discord discussion a few months ago that mentioning commenting out STORAGE_URL helped but it was not effective for me
given the logs mention a 403 and not a 404, this could be an authentication issue but given I have set this bucket to be public I am not sure what could still be causing it.
Thank you for any help, and please let me know if more info is needed!
Exact BookStack Version
v24.05.3
Log Content
Details
Hosting Environment
Bookstack running in docker on ubuntu server, minio running on a separate truenas instance. Both go through the same nginx reverse proxy but under separate subdomains. Both subdomains are behind cloudflare.
@ssddanbrown commented on GitHub (Jul 31, 2024):
Hi @Rami-Pastrami,
Do those minio 403 logs occur each time you try to upload?
Just want to be sure they're connected here.
If so, It makes sense for the error thrown. BookStack will initially be doing a GET to check if a file already exists, which correlates with the error and logs.
Does your S3 key or secret contain any special characters? If so, which?
@Rami-Pastrami commented on GitHub (Jul 31, 2024):
This happens every time, correct. Neither the key or secret contain any special characters, it is fully alphanumeric
@Rami-Pastrami commented on GitHub (Aug 8, 2024):
Still trying to figure out whats going on.
Pulled the docker image to get to bookstack v24.05.3, that didnt seem to do anything.
the name of my bucket had hyphens, so I switched to a bucket with a name consistent only of lower case letters, no change
I tried switching from using a user to login, to using a token to login to the user, and using a token directly. no change.
I changed the bucket back to "private" but customized the permissions so that anonymous public users can read the contents (the intended setup):
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": [ "*" ] }, "Action": [ "s3:GetBucketLocation", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::[BUCKETNAME]" ] }, { "Effect": "Allow", "Principal": { "AWS": [ "*" ] }, "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::[BUCKETNAME]/*" ] } ] }Please let me know if there is anything else to try, this is a perplexing issue
@ssddanbrown commented on GitHub (Aug 9, 2024):
@Rami-Pastrami I performed a test run with Minio since it had been a while since I last tested that combo.
Could get things working although I could get the same error if not using a key for an actual user entry that has write access to the bucket.
I recorded the process end-to-end from a fresh stack so you could see exactly what I do:
https://foss.video/w/9noJP3x5gnmQ4bNUAg47qs
@Rami-Pastrami commented on GitHub (Aug 9, 2024):
Wow, thanks for the video walkthrough!
so TLDR I followed the steps provided and it fixed my issue in my particular use-case when connecting to Minio with a direct LAN IP, but it seems to error out in the above manner when connecting via external domain
Steps Taken:
At this point I confirmed that image uploading worked correctly, as well as viewing! I confirmed this test from both within the same LAN as the servers and externally over cellular.
I restored permissions instead of using global permissions on Minio account, everything continued working
However, if I change "STORAGE_S3_ENDPOINT" to use the external domain of my Minio instance, I end up with the same error. Switching back and forth between using the local IP and using the external one is the one singular value I can change to cause the error or not.
I am using the internal LAN IP for STORAGE_S3_ENDPOINT as per the video currently as it resolves the issue for my setup. However if Minio was being run externally, I am unsure if this work around would have worked.
If it means anything, my set up is as follows:
Minio / Bookstack running on 2 devices within the same lan -> shared NGINX reverse proxy -> NAT / router -> cloudflare -> each service has the same root domain but each have their own subdomain.
Cloudflare does have a limit of ~100 mb for single files, but my tested images were ~5 mb so I doubt that was any issue.
I am alright with having this Github issue be closed, but let me know if you have any questions.
Thanks for your help!
@ssddanbrown commented on GitHub (Aug 9, 2024):
So that makes me suspicious of the cloudflare and NGINX proxies involved, more so of Cloudflare.
Something to note is that access is authenticated with the
Authorizationheader.This being dropped/altered would result in the error you're seeing.
This can often occur if there are redirects involved in HTTP requests (clients will drop this to avoid leaking secrets).
Ensure your
STORAGE_S3_ENDPOINTprovides a complete direct route to the MINIO system.By that, I mean check things like protocol (
https://vshttp://) and (with/without) trailing slashes.If any parts inbetween (cloudflare/nginx) are performing redirects to handle these (to ensure slashes or upgrade to https) then that could be adding a redirect and potentially result in the
Authorizationheader being dropped.@ssddanbrown commented on GitHub (Dec 21, 2025):
Since it's been a while since the last response I'm going to go ahead and close this off.