Active
Project:
Flysystem - S3
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2025 at 22:42 UTC
Updated:
20 Nov 2025 at 12:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
marcus.w commentedI'm seeing the same issue but using 3.0.0 as using Drupal 11 and can't downgrade
Comment #3
joshhytr commentedHi all,
I have experienced a similar issue on a site that I maintain.
I found that if the 'public' config key for the flysystem scheme was set to FALSE, or not set (default is FALSE), then image styles were not being generated or placed on my S3 bucket. Nor were the routes for the image styles being registered, hence the 404.
I also found that if I set 'public' to TRUE, my image styles derivatives would generate and be placed into my S3 bucket, but my image links then linked directly to the bucket. The links directly to the bucket are the advertised behaviour of this config option.
This caused problems for us because we have a setup whereby we proxy the images from S3, through the flysystem Drupal route, then through a CDN. The CDN module was not behaving well with the direct S3 paths - as we'd expect.
I needed public to be FALSE, so that image URLs were still pointing to Drupal routes, but I needed the image styles to be generated and their routes to be registered.
I don't quite understand what expected behaviour is here, or if there is native configuration to support this. This used to work and stopped working within the past few months, but I can't pinpoint exactly when.
I've got my setup working by applying two patches: one to flysystem and one to flysystem_s3.
I've going to include them here for community testing, but I do not think they're appropriate to merge into the module so I'm not going to create a fork and MR. The reason being that I could be introducing breaking changes to the public config.
It would be great to hear more about your configurations end-to-end and whether these patches work for you! Then we can plan a long-term fix.
These patches apply to flysystem 2.2.0 and flysystem_s3 2.1.4.
My site is not quite ready for D11 yet so I am using the older releases. That being said, for those using the new releases, I think this patch should be quite straightforward to re-roll.
Please see attached patches:
flysystem 2.2.0: flysystem_register_image_style_routes_with_public_false.patch
flysystem_s3 2.1.4: flysystem_s3_generate_image_style_derivatives_with_public_false.patch
Thanks
Comment #4
marcus.w commentedI just applied the flysystem patch and it worked on 2.3, didn't even need the flysystem_s3 patch