corley / aws-ant-task

Ant task implementation for Amazon Web Services
MIT License
16 stars 14 forks source link

wrong endpoint? #14

Closed mediamods closed 11 years ago

mediamods commented 11 years ago

I am unable to use s3put to upload files to my bucket.

com.amazonaws.AmazonClientException: Unable to execute HTTP request: bucket-name.s3-us-east-1.amazonaws.com
...
Caused by: java.net.UnknownHostException: bucket-name.s3-us-east-1.amazonaws.com

Do I need to enable Static Website Hosting? Maybe I have used the wrong endpoint address?
bucket-name.s3-website-us-east-1.amazonaws.com

( I used my static website hosting endpoint as a starting point for determining what my endpoint is.)

wdalmut commented 11 years ago

Hi,

no absolutely, the ant task uses the Java SDK in order to upload files and its not related to website hosting.

Can you copy & paste an abstract of your task for upload? (do not copy your aws credentials)

Thanks Walter

mediamods commented 11 years ago

If I omit endpoint (as I used to do back with version ~ .3), I get a different error

Status Code: 301, AWS Service: Amazon S3, AWS Request ID: 2E41F2D50B1535BE, AWS Error Code: PermanentRedirect, AWS Error Message: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint., S3 Extended Request ID: 9h4FylBPvAsldLuYtinwyTgiWBPGh/q3+c10GTldHzXXwo6r49PaNbGYhSs7s9YK

Here is my task:


        <taskdef name="s3put" classname="it.corley.ant.S3PutTask" classpath="aws-ant-tasks-0.5-SNAPSHOT.jar"/>

        <s3put
                endpoint="s3-us-east-1.amazonaws.com"
                key="${aws.access_key}"
                secret="${aws.access_secret}"
                bucket="mmods-home"
                dest="site/${date-now}">
            <fileset dir="${client-pub}">
                <exclude name="**/*.html"/>
            </fileset>
            <contenttypemapping extension=".js" contenttype="text/javascript"/>
            <contentencodingmapping extension=".gz.js" encoding="gzip"/>
            <contenttypemapping extension=".css" contenttype="text/css"/>
            <contentencodingmapping extension=".gz.css" encoding="gzip"/>
            <contenttypemapping extension=".png" contenttype="image/png"/>
            <contenttypemapping extension=".ico" contenttype="image/vnd.microsoft.icon"/>
            <contenttypemapping extension=".gif" contenttype="image/gif"/>
        </s3put>
wdalmut commented 11 years ago

Can you try to use the Standard US endpoint instead the real region? (I think that it works only for US regions)

s3.amazonaws.com

mediamods commented 11 years ago

that did it. thanks.