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

[v3.x] Leveraging the new Subpath option within a volume in Craft 5 causes Rekognition to return a 400 error #173

Closed
kylecotter opened this issue Feb 21, 2024 · 3 comments
Labels

Comments

@kylecotter
Copy link

Description

A filesystem with Attempt to set the focal point automatically? enabled, a subfolder set, and a Volume leveraging this filesystem with a subfolder set, results in the Rekognition api returning a 400 Unable to get object metadata from S3

Not leveraging a subfolder in the volume prevents the error.

Specifically, I have a filesystem named Cloud Provider. The subfolder of this filesystem is @s3BasePath which is an alias of a path that gets set based on the environment we're working in.

I have 2 volumes. One named Uploads and one named User Photos. Both volumes use the Cloud Provider filesystem. Both volumes set their subpath to uploads and users respectively. When uploading a user photo, the error occurs.

If however, I remove the subpath from the volumes, and setup two bespoke filesystems (how we would in Craft 4) for their corresponding volume, this issue does not occur.

Steps to reproduce

  1. Create a filesystem with a subfolder path. e.g @s3BasePath
  2. Enable Attempt to set the focal point automatically?
  3. Create a volume using this new filesytem
  4. Set the subpath of the volume to foobar
  5. Save the volume
  6. Upload an image via the CP
  7. Get 400 error toast notification

Additional info

  • Craft version: 5.0.0-beta.2
  • PHP version: 8.2.16
  • Database driver & version: MySQL 8.0.30
  • Plugins & versions: S3 v3.x-dev
@kylecotter kylecotter added the bug label Feb 21, 2024
@brandonkelly
Copy link
Member

This should be fixed in v2.1.0, which supports both Craft 4 and 5. You can change your craftcms/aws-s3 requirement to ^2.1.0 and run composer update to get it.

@kylecotter
Copy link
Author

@brandonkelly Was still hitting this issue after updating.

Pretty sure the $filesystem subfolder path should come first before the volume path here.

brandonkelly added a commit that referenced this issue Mar 23, 2024
@brandonkelly
Copy link
Member

@kylecotter Doh, you’re right. Just fixed and tagged 2.2.1.

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

No branches or pull requests

2 participants