Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda