Troubleshooting Amazon S3 Connection for Data Import and Export Tasks
3 minutes to readIf you use Amazon S3 for data import/export tasks and see a “Connection failed” error, follow this article to fix it.
Symptoms and cause
You may experience one or more of the following:
- The Amazon S3 site connection shows “Connection failed”
- Data import/export tasks fail with an error similar to:
“Caspio could not connect to server [SiteName]. Verify your server availability and credentials.”
This issue can occur even if the connection worked previously and your AWS credentials have not changed.
To connect to Amazon S3, Caspio must identify the AWS region where your S3 bucket is hosted. If the AWS Identity and Access Management (IAM) user associated with your S3 site does not have permission to get the bucket location, the task fails. This typically affects only customers who have restricted IAM permissions. If your IAM user has broad permissions (for example, s3:*), no action is required.
When you need to take action
You only need to follow the steps below if all of the following apply:
- You use Amazon S3 for data import/export tasks
- Your S3 connection or tasks fail
- Your AWS IAM policy is restricted and does not include
s3:GetBucketLocation
If you are not sure, your AWS administrator can check the IAM policy for the user whose Access Key and Secret Key are configured in Caspio.
How to fix the issue
Update your AWS IAM user associated with your S3 site with the required permissions for your bucket. You can update the IAM policy using the AWS IAM Console, CLI, or API. If someone else manages your AWS environment, share this article with them.
Below are the required minimum policies for running data import and export tasks. Paste the respective policy and replace YOUR_BUCKET with the name of your S3 bucket.
Data import tasks
Use this policy if you import data into Caspio from Amazon S3:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::YOUR_BUCKET"
},
{
"Sid": "VisualEditor2",
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::YOUR_BUCKET/*"
}
]
}
Data export tasks
Use this policy if you export data from Caspio to Amazon S3:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::YOUR_BUCKET"
},
{
"Sid": "VisualEditor2",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts"
],
"Resource": "arn:aws:s3:::YOUR_BUCKET/*"
}
]
}
After updating the policy, test the S3 connection again and rerun the failed task.
If the connection continues to fail after updating the permissions, contact Caspio Support and include:
- The name of your S3 site in Caspio
- Whether the issue affects data import tasks, data export tasks, or both
- The exact error message you see