cffile copy to AWS S3 failed silently

151 views
Skip to first unread message

Peter Pham

unread,
Jun 7, 2016, 8:50:47 AM6/7/16
to Lucee
I have the following code

<cfset S3 = {
accessKeyId = '...'
, awsSecretKey = '...'
, bucket = '...'
}>



<cffile action="copy" source="tiger1.png" destination="s3://#S3.accessKeyID#:#S3.awsSecretKey#@#S3.bucket#/">

<cfdirectory name="q" action="list" directory="s3://#S3.accessKeyID#:#S3.awsSecretKey#@s3-ap-southeast-2.amazonaws.com/#S3.bucket#" recurse="true" />
<cfdump var="#q#" />


I can use <cfdirectory> and it returns the list of files correctly.
However, <cffile> copy  had failed silently (no error but file was not uploaded at all).
Checking catalina.out , I noticed

07-Jun-2016 22:14:29.182 WARNING [http-nio-8888-exec-5] org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest Retrying request following error response: PUT '/tiger1.png' -- ResponseCode: 307, ResponseStatus: Temporary Redirect, Request Headers: [Date: Tue, 07 Jun 2016 12:14:28 GMT, x-amz-content-sha256: f28fabb188c9dbd3b7daa4331f2da644a5c788f126da9505427f5f4585ec69e4, x-amz-acl: public-read, x-amz-meta-md5-hash: 6c7b05fadebc4675f366e3454bff3b34, Content-MD5: bHsF+t68RnXzZuNFS/87NA==, Content-Type: image/png, Authorization: AWS AKIAIFLYSX5V4VIIKLAQ:TVtctDTgcXT21mBEvKBC/EbHe1X=, Host: bucket.s3-ap-southeast-2.amazonaws.com], Response Headers: [x-amz-request-id: 3A293EBC2D4BB757, x-amz-id-2: 19tJV6Rp9rLqyIxPmzNfgjeGN72cMkPeb4SvbT9PFgo1LcFhhR87VZFo5oSuClTgbYyvw3fucyQ=, Location: https://bucket.s3-ap-southeast-2.amazonaws.com/tiger1.png, Content-Type: application/xml, Transfer-Encoding: chunked, Date: Tue, 07 Jun 2016 12:14:28 GMT, Connection: close, Server: AmazonS3]

The response returned was error code 307.
Is there a way to fix this?

My bucket is at s3-ap-southeast-2
Lucee version: lucee-express-5.0.0.252
Reply all
Reply to author
Forward
0 new messages