mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-07 19:06:05 +03:00
Since v21.04.3 (maybe sooner) uploading images doesn't work if using S3 storage #2239
Closed
opened 2026-02-05 03:25:49 +03:00 by OVERLORD
·
14 comments
No Branch/Tag Specified
development
l10n_development
further_theme_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
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#2239
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 @diegopau on GitHub (May 10, 2021).
Describe the bug
We have been using Amazon S3 storage without issues up to version v21.04, last Friday I upgraded to v21.04.3 and we are unable to upload pictures if we use the "Insert an image" option in the editor. Attachments do work if we upload the same image from the Attachments panel. The error is "File path /updates/images/gallery/{image_name} could nto be uploaded to. Ensure it is writable to the server". The same error happens with v21.04.4
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should upload to Amazon S3
Screenshots

Your Configuration (please complete the following information):
Additional context
Our Amazon S3 bucket is set to public, and also we didn't touch the permissions in a while. I also didn't touch the .env file in a while.
@ssddanbrown commented on GitHub (May 10, 2021):
Hi @diegopau,
Just double checked things against my test AWS S3 bucket and all appeared to work on image upload, using BookStack v21.04.4.
composer installstep definitely complete without issues on your system? Just ensuring you've definitely got the latest AWS files.@diegopau commented on GitHub (May 10, 2021):
@ssddanbrown thanks for checking this so quickly.
I can't say for sure what was the output for compose install when upgrading to 21.04.3 but for 21.04.4 I still had it in my terminal:
I am using AWS S3 (not a compatible service).

I have this option enabled:
The policy for accessing the bucket is:
so it doesn't distinguish from one folder or the other and however attachments ("files" folder) do upload correctly, images not.
It seems that the issue is on my side (since it works for you, probably for others that didn't report any issues) so I will surely investigate this a bit more on my end and report.
@ssddanbrown commented on GitHub (May 10, 2021):
@diegopau Looks like the composer install all went okay.
I did change the image upload for AWS-style storage to be upload+set-public ACL in a single action instead of doing those as two separate operations, Might have affected things but not sure why.
I did add better logging of these kind of errors when doing changes, Check your
storage/logs/laravel.logfile, Searching for lines starting withError when attempting image upload:for more details.@diegopau commented on GitHub (May 10, 2021):
@ssddanbrown
Yes, there are indeed many errors related with image upload, they all look like this:
there are also these error but probably unrelated:
@diegopau commented on GitHub (May 12, 2021):
@ssddanbrown I rolled back to 21.04.2 and it is working now. So it seems to be introduced in 21.04.3
@ssddanbrown commented on GitHub (May 13, 2021):
Okay, Looks like my presumption of (PUT Request with ACLs) being the same as (PUT Request then ACL request) was wrong. From the AWS docs:
So looks like providing the IAM policy for the connected BookStack account with
PutObjectAclpermission would work. This may break other instances though.Gets tricky, I made this change to simplify things to work better with S3-like systems that were breaking the old way. Might need to do some config sniffing and treat S3 differently to S3-like here.
@diegopau commented on GitHub (May 13, 2021):
Alright @ssddanbrown thank you for the update, this explains the 403 Forbidden responses. For now I will stay on 21.04.2 and keep an eye on this issue in case there is a change on the AWS S3 implementation.
@ssddanbrown commented on GitHub (May 15, 2021):
@diegopau I've just released v21.04.5 with a patch to change the behaviour back to that of 21.04.2 for AWS S3 usage, but with some tweaks to avoid issues for those using non-AWS S3 services.I'll therefore close this off but just shout if you still have any issues after upgrading to v21.04.5.
@diegopau commented on GitHub (May 17, 2021):
Thanks, I can confirm that all is working after upgrading to 21.04.5
@ssddanbrown commented on GitHub (May 17, 2021):
@diegopau Awesome, Thanks for confirming!
@sherpya commented on GitHub (May 19, 2021):
I suspect
c1f070a136broke local storage ffile permissions, now they are 640 instead of 644@ssddanbrown commented on GitHub (May 19, 2021):
Did yours break @sherpya? I'd have thought that in the vast majority of cases these files will be uploaded with an owner and/or group matching the server process that would be serving static files.
@sherpya commented on GitHub (May 20, 2021):
yes I use php-fpm with a dedicated user for bookstack, static files are server by nginx that runs as different user
@ssddanbrown commented on GitHub (May 21, 2021):
🤦 Thanks @sherpya for confirming and my apologies. Have opened #2758, assigned to the next patch, to cover this.