The AWS Access Key Id you provided does not exist in our records

While performing an inner loop of querying an S3 bucket’s contents, I encountered the following error:

An unhandled exception of type ‘Amazon.S3.AmazonS3Exception’ occurred in AWSSDK.Core.dll
Additional information: The AWS Access Key Id you provided does not exist in our records.

This seemed strange as the Access key and the Secret Access key were both correct.

I had implemented the following code in the inner loop:

GetObjectResponse objectResponse = new AmazonS3Client(s3Object.BucketName, awsAccessKey, awsSecretAccessKey).GetObject(requestObject);

I then tried to change the code to get the objectResponse without supplying the BucketName in the query:

GetObjectResponse objectResponse = new AmazonS3Client(awsAccessKey, awsSecretAccessKey).GetObject(requestObject);

And it worked just fine 🙂

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s