EC2ResponseError: 401 Unauthorized AWS was unable to verify the granted access for the ec2 instance

I have two instances of ec2 A and B both in the same region, security group, etc. I use boto to make the connection.

After updating boto from version 2.34.0 to version 2.35.0, I cannot connect to the node from instance A, but can connect from instance B.

<Code> AuthFailure AWS failed to verify the provided access credentials

I found out that a possible cause of such a problem is boto Switch elb / ec2 to version 4 signature

How is it possible that I can connect from machine B but could not connect to machine A? (python code responsible for the connection, in both cases)

What could cause such a strange situation? thank

+4
source share
1 answer

The SigV4 authentication method puts a greater demand for clock synchronization on the requesting device with the clock on the server. It is possible that the watch on the instance that is no longer working has failed beyond the 5-minute limit, but is still within the 15-minute limit required by the previous SigV2 signature algorithm.

Try to synchronize the clock in both instances.

+5
source

All Articles