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

Unable to check {filename} exists - Using Cloudfront as Base URL #180

Closed
padmedia opened this issue Aug 15, 2024 · 1 comment
Closed

Unable to check {filename} exists - Using Cloudfront as Base URL #180

padmedia opened this issue Aug 15, 2024 · 1 comment
Labels

Comments

@padmedia
Copy link

Description

I am using http://####.cloudfront.net as the Base URL (I've hashed out the actual details).

I get an 'Unable to check if {filename} exists.

Screenshot 2024-08-15 at 16 30 06

Looking through web log, I can see the Cloudfront URL is being converted automatically into an amazonaws.com domain. E.g:

[web.ERROR] [craft\errors\FsException] GuzzleHttp\Exception\ClientException: Client error: HEAD https://####.s3.me-south-1.amazonaws.com/placeholder-image.jpg resulted in a 400 Bad Request response in /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

The URL doesn't exist, so correctly returns unable to check {filename} exists, as the Base URL has been changed.

Steps to reproduce

  1. Use a Cloudfront URL as Baseurl for S3 Asset
  2. Try to upload a file.
  3. Get failure message.

Additional info

(Using Craft DDEV)

  • Craft version: 5.2.4.1
  • PHP version: 8.2
  • Database driver & version: mysql 8.0
  • Plugins & versions:
"craftcms/aws-s3": "2.2.1",
"craftcms/ckeditor": "4.1.0",
"craftcms/cms": "5.2.4.1",
"nystudio107/craft-cookies": "5.0.0",
"nystudio107/craft-imageoptimize": "5.0.2",
"nystudio107/craft-retour": "5.0.2",
"nystudio107/craft-seomatic": "5.0.4",
"verbb/field-manager": "4.0.1",
"verbb/navigation": "3.0.1",
"verbb/super-table": "4.0.1",
"vlucas/phpdotenv": "^5.4.0",
"wrav/oembed": "3.0.8"

Is there a way to stop the Filesystems Base URL from being changed into a amazonaws.com domain

Or any advice.

Many thanks in advance,

Rob

@padmedia padmedia added the bug label Aug 15, 2024
@padmedia
Copy link
Author

Turns out it was user error - Turned out to be an additional space in the IAM permissions.

If you get this error, worth triple checking your IAM permissions.

Hopefully this helps someone out.

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

1 participant