4

I'm trying to use the KNPLabs gaufrette bundle to upload image files to S3. I'm getting the following error when I debug the response from S3:

The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

images.mynamespace.com.s3.amazonaws.com

I've tried setting the base_url parameter to that endpoint but still get the same error. There are other questions on SO suggesting setting the region which I have also tried.

The bucket I'm trying to upload to is in the EU West region (Ireland). No matter what config I try, gaufrette still seems to be trying to use s3.amazonaws.com

How can I configure gaufrette correctly?

config.yml:

knp_gaufrette:
    adapters:
        image_storage:
            amazon_s3:
                amazon_s3_id: mynamespace_admin.amazon_s3
                bucket_name:  %amazon_s3_bucket_name%
                create:       false
                options:
                    create:     true
                    directory: 'dirname'
                    region:     eu-west-1


    filesystems:
        image_storage:
            adapter:    image_storage
            alias:      image_storage_filesystem
codecowboy
  • 9,835
  • 18
  • 79
  • 134
  • Can you please share the portion of the config file where you have set your adapters ? also for region you have to pass region in adapters options. – Kapil Apr 26 '14 at 06:16
  • @Kapil thanks. Putting the full region endpoint url resolved the problem – codecowboy Apr 26 '14 at 06:21

1 Answers1

7
I needed to set region to s3-eu-west-1.amazonaws.com

knp_gaufrette:
    adapters:
        image_storage:
            amazon_s3:
                amazon_s3_id: mynamespace_admin.amazon_s3
                bucket_name:  %amazon_s3_bucket_name%
                create:       false
                options:
                    create:     true
                    directory: 'dirname'
                    region:     s3-eu-west-1.amazonaws.com
codecowboy
  • 9,835
  • 18
  • 79
  • 134
  • Thank you! I wasn't even getting an error....just wasn't uploading...adding the region did the trick for me- – Pez May 04 '14 at 17:11
  • can you give what is the mean use of gaufrette: simple explination plz – famas23 Nov 04 '17 at 19:42