aws s3 cp occasionally throws Segmentation fault

0

This:

UPLOAD_PATH="s3://bucket/"
aws s3 cp target "$UPLOAD_PATH" --recursive --acl public-read

Occasionally produces this: Segmentation fault: 11 aws s3 cp target "$UPLOAD_PATH" --recursive --acl public-read

Working environment: MacOS X aws-cli/2.24.10 Python/3.12.9 Darwin/23.4.0 exe/x86_64

asked 2 months ago188 views
1 Answer
0

The issue you're experiencing with the AWS CLI occasionally throwing a segmentation fault during an S3 copy operation could be due to a few factors:

  1. ACL settings: The use of the --acl public-read flag might be causing issues if the bucket has certain access control settings. Some S3 buckets have ACLs disabled, which can lead to errors when trying to set ACLs on objects.

  2. Permissions: Ensure that your IAM user or role has the necessary permissions to perform the S3 copy operation and set ACLs.

  3. AWS CLI version: While you're using a recent version of the AWS CLI, there could be a bug specific to your environment or this particular version. You might want to try updating to the latest version or rolling back to a previous stable version to see if the issue persists.

  4. Large number of files: If you're copying a large number of files, the CLI might be running into memory issues, leading to the segmentation fault.

To troubleshoot this issue:

  1. Try the operation without the --acl flag to see if it completes successfully.

  2. Check your S3 bucket settings to ensure ACLs are enabled if you need to use the --acl flag.

  3. Verify that your IAM permissions include s3:PutObject, s3:PutObjectAcl, and s3:ListBucket for the relevant resources.

  4. Consider using the sync command instead of cp, as it might handle large numbers of files more efficiently:

    aws s3 sync target "$UPLOAD_PATH" --acl public-read
    
  5. If the issue persists, you may want to try breaking up the operation into smaller batches or use a different tool like the AWS SDK for more robust error handling.

If none of these solutions work, you may need to contact AWS support for further assistance, as segmentation faults can sometimes indicate underlying issues with the AWS CLI itself.
Sources
Data copy using s3 batch | AWS re:Post
Troubleshooting - Amazon Simple Storage Service

profile picture
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions