S3ServiceException access denied

232 views
Skip to first unread message

chri...@gmail.com

unread,
Apr 3, 2009, 5:51:05 PM4/3/09
to JetS3t Users
Hi,

I'm developing a java program using jets3t-0.5.0.jar to upload a file
to S3 and monitor the progress. At the end of the process when the
file is 95~97% uploaded, I always got this error message:
- A thread failed with an exception. Firing ERROR event and cancelling
all threads
org.jets3t.service.S3ServiceException: S3 PUT failed. XML Error
Message: <?xml version="1.0" encoding="UTF-8"?
><Error><Code>AccessDenied</Code><Message>Access Denied</
Message><RequestId>ACBEBF10916EB436</RequestId><HostId>sVt7NiPRc/
gQAmDjMd5Hdlip4ABadzL9NaR2uZgiCsDbQlKZ4RUuIjAD2RL4fkU2</HostId></
Error>
at
org.jets3t.service.impl.rest.httpclient.RestS3Service.performRequest
(RestS3Service.java:299)
at
org.jets3t.service.impl.rest.httpclient.RestS3Service.performRestPut
(RestS3Service.java:565)
at
org.jets3t.service.impl.rest.httpclient.RestS3Service.createObjectImpl
(RestS3Service.java:962)
at org.jets3t.service.impl.rest.httpclient.RestS3Service.putObjectImpl
(RestS3Service.java:918)
at org.jets3t.service.S3Service.putObject(S3Service.java:706)
at org.jets3t.service.S3Service.putObject(S3Service.java:731)
at org.jets3t.service.multithread.S3ServiceMulti
$CreateObjectRunnable.run(S3ServiceMulti.java:1083)
at java.lang.Thread.run(Unknown Source)

If I switch the jar file to jets3t-0.7.0.jar or jets3t-0.6.0.jar, I
will get this message even before the upload process started!

Do you have some ideas to solve this problem? Thanks!

Chris

James Murty

unread,
Apr 3, 2009, 6:05:13 PM4/3/09
to jets3t...@googlegroups.com
This issue is most likely caused by incorrect AWS credentials. Check
to make sure that your credentials are set properly, and look in
particular for extra space characters after the letters -- these can
easily sneak in when you copy-and-paste your credentials from the AWS
web page.

I would strongly recommend using the latest JetS3t library. The fact
that it "fails" earlier is a good thing, as it shows that S3 is
checking your credentials before uploading the data, instead of
afterwards. The later library versions make better use of HTTP to
allow for this pre-verification.

James

chri...@gmail.com

unread,
Apr 3, 2009, 7:42:38 PM4/3/09
to JetS3t Users
Thank you James for the reply. I tried with the same AWS credentials
and I could upload files in cockpit gui:
http://jets3t.s3.amazonaws.com/applets-jets3t-0.6.0/jets3t-cockpit.html

And also if the AWS credentials were incorrect, I wouldn't able to
access the first 98% of the file. The "S3 PUT failed" with
accessDenied
happens only at the last part of the uploading.


On Apr 3, 3:05 pm, James Murty <ja...@misterm.org> wrote:
> This issue is most likely caused by incorrect AWS credentials. Check  
> to make sure that your credentials are set properly, and look in  
> particular for extra space characters after the letters -- these can  
> easily sneak in when you copy-and-paste your credentials from the AWS  
> web page.
>
> I would strongly recommend using the latest JetS3t library. The fact  
> that it "fails" earlier is a good thing, as it shows that S3 is  
> checking your credentials before uploading the data, instead of  
> afterwards. The later library versions make better use of HTTP to  
> allow for this pre-verification.
>
> James
>

James Murty

unread,
Apr 3, 2009, 9:53:24 PM4/3/09
to jets3t...@googlegroups.com
The AccessDenied error means the same thing regardless of when it
happens, don't mistake a difference in HTTP handling between the
library versions for something else.

If the AWS credentials in your code are correct, the only other thing
I can think of is that you may not have write access for the S3 bucket
you are using. Otherwise, I'm stumped.

Can you try downloading a file with your code to see if this causes
the same error?

James
Reply all
Reply to author
Forward
0 new messages