Mithun Biswas
Mithun Biswas

Reputation: 1833

Credential named assume-role-with-web-identity not found

On my amazon linux ec2 instance, I have the iam-role attached with proper permission, I ran the command $ sudo yum update . After this I started getting the error Credential named assume-role-with-web-identity not found for command aws s3 ls. But if I add sudo and run the command sudo aws s3 ls then it works fine.

Please help me to find the issue. Thanks in advance.

Upvotes: 6

Views: 6852

Answers (6)

Student
Student

Reputation: 684

I had the same issue on macOS. Upgrading both botocore and awscli did the trick:

pip3 install --upgrade botocore awscli

Upvotes: 4

silverdagger
silverdagger

Reputation: 1172

I had this same issue on an image that had installed botocore separately from awscli and that was the version (botocore 1.12.172) it seemed to be picking up. Once I upgraded to botocore 1.12.200 and run the image build again, it resolved this issue above.

pip install botocore==1.12.200
{ brew | apt-get }  install awscli

This should resolve the issue above without having to downgrade awscli.

See also: https://github.com/aws/aws-cli/issues/4371

Upvotes: 0

Umesh Kumhar
Umesh Kumhar

Reputation: 816

You need to update botocore==1.12.201

pip install botocore==1.12.201

For detail refer here: https://github.com/aws/aws-cli/issues/4371#issuecomment-518792844

Upvotes: 6

David Dombrowsky
David Dombrowsky

Reputation: 1705

To downgrade the ubuntu package, you can use:

$ apt-cache madison awscli
    awscli | 1.18.69-1ubuntu0.18.04.1 | http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
    awscli | 1.18.69-1ubuntu0.18.04.1 | http://us.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages
    awscli | 1.14.44-1ubuntu1 | http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
    awscli | 1.14.44-1ubuntu1 | http://us.archive.ubuntu.com/ubuntu bionic/universe i386 Packages

Then select the correct one and install using apt-get:

$ sudo apt-get install awscli=1.14.44-1ubuntu1 -V
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be DOWNGRADED:
   awscli (1.18.69-1ubuntu0.18.04.1 => 1.14.44-1ubuntu1)
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 482 kB of archives.
After this operation, 4,870 kB disk space will be freed.
Do you want to continue? [Y/n]

Upvotes: 1

Mithun Biswas
Mithun Biswas

Reputation: 1833

Downgraded the version of aws-cli and it got fixed. commands used:

$ curl https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip -o awscli-bundle.zip
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/bin/aws

Upvotes: 10

Chris Williams
Chris Williams

Reputation: 35146

Looks like a known issue, take a look at https://github.com/aws/aws-cli/issues/4371

Upvotes: 4

Related Questions