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.