Skip to content

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

@padmedia

Description

@padmedia

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions