[Amazon](500310) Invalid operation: CREDENTIALS argument is not supported when loading from file system
Sometimes, we missed to notice reason for an error with small oversight. That's what exactly happened with me when I was loading data from S3 to Redshift. I researched on google to find out an answer and had no luck. Finally, I realized the mistake and so thought of sharing my mistake that may help others who may come across with similar situation:
My Scenario : Loading data from S3 to Redshift
Sample Syntax :
copy ReadLog(LogData)
FROM 'S3://bucketname/' CREDENTIALS 'aws_access_key_id=xxxxxxxxxxx;aws_secret_access_key=xxxxxxxxxx'
Error Message:
An error occurred when executing the SQL command:
copy ReadLog(LogData)
FROM 'S3://bucketname/' CREDENTIALS 'aws_ac…
[Amazon](500310) Invalid operation: CREDENTIALS argument is not supported when loading from file system;
Execution time: 0.08s
1 statement failed.
Root Cause:
S3 typed in UPPER CASE. Hence, Error message indicating issue with CREDENTIALS argument, was NOT the case
Resolution:
Changed S3 to LOWER CASE that changed syntax as shown below:
copy ReadLog(LogData)
FROM 's3://bucketname/' CREDENTIALS 'aws_access_key_id=xxxxxxxxxxx;aws_secret_access_key=xxxxxxxxxx'
Final Outcome:
Data Loaded successfully with following message returned:
Warnings:
Load into table 'readlog' completed, 1 record(s) loaded successfully.
0 rows affected
copy executed successfully
Execution time: 0.36s
Hi,
Thanks alot for this. I was also facing the same problem and it helped.
Thank you so much Anshu! Glad to hear that it helped.