Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
AWS CLI: copy command fails when copying from instance to bucket

I have two EC2 instances running in a custom VPC, with one running Ubuntu 16.04 and the other running Amazon Linux 2017.03. I have also assigned a IAM Role that allows read and write access to all S3 buckets.

However when I try to run the copy command, to copy a file from the instance to the S3 bucket, it fails on the Ubuntu server. The command I run on both servers is:

aws s3 cp /myfolder/myfile.txt s3://mybucket/backups/

It gives the following error on Ubuntu:

upload failed: ../../myfolder/myfile.txt to s3://mybucket/backups/myfile.txt seek() takes 2 positional arguments but 3 were given

Everything else works, for example, downloading a file from the bucket to the server through the copy command. There is no problem in the VPC setting and neither the IAM Role nor the Security Group, since the same applies to the other server running Amazon Linux.

PS: Running the copy command with the --dryrun switch gives no error on the Ubuntu server.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Most likely it's python version and aws cli version mismatch issue. Post aws cli version and python version

python -V
aws --version

Install awscli with pip only so that it gets proper python version.

pip install awscli

Ref: github.com/aws/aws-cli/issues/2403

about 4 years ago · Santiago Trujillo Report

0

I have the same issue. The problem is I used the Ubuntu package manager to install the aws package. We should use this command to install the aws command:

pip3 install awscli --upgrade --user

for more information, see Installing, updating, and uninstalling the AWS CLI in the documentation.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!