3

I'm trying to use awssdk to upload backups to amazon s3 - everything works great, but only for US servers. I'm located in EU and I would like to use the EU servers, but when I try to do any bucket related action (for example ListObjects) it fails after a while with message:

Maximum number of retry attempts reached : 3

Url used by awssdk is https://s3.amazonaws.com/algorim.eutest/ which seem to be a problem as it returns following xml:

<Error>
    <Code>PermanentRedirect</Code>
    <Message>
        The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
    </Message>
    <RequestId>89A688C2DF03C1BC</RequestId>
    <Bucket>algorim.eutest</Bucket>
    <HostId>
        AN27BUv30i4UCE4WkQqgqGUdNm12OaDQkB+/r0cKowb2VOduniIOZXYIngvE2lSj
    </HostId>
    <Endpoint>algorim.eutest.s3.amazonaws.com</Endpoint>
</Error>

whereas the same kind of url on US server results in

<Error>
    <Code>AccessDenied</Code>
    <Message>Access Denied</Message>
    <RequestId>EE2307DE5E5815FD</RequestId>
    <HostId>
        J0tmOtg9xvUvC2T1CRvQcU2MJdOsXBCRYJexvhIgpbDwPfc3PpNCUNv/USatebyy
    </HostId>
</Error>

which is the expected answer. Basically it looks like .net awssdk is not able to follow the redirect and bails. Is there any way around this without writing own or using 3rd party amazon web service wrapper?

Used awssdk version is 1.3.13.0

Charles
  • 50,943
  • 13
  • 104
  • 142
Lukáš Novotný
  • 9,012
  • 3
  • 38
  • 46

2 Answers2

2

As I understand it, you have to use EU-specific endpoint (s3-eu-west-1.amazonaws.com) to work with data in EU datacenter.

driushkin
  • 3,531
  • 1
  • 24
  • 25
0

Check out this post for a full code sample showing how to set the EU-specific endpoint and where to find them.

Community
  • 1
  • 1
Daniel Gill
  • 3,261
  • 2
  • 23
  • 21