

Bad Ansible Error Message - No handler was ready to authenticate
source link: https://fuzzyblog.io/blog/ansible/2019/07/08/bad-ansible-error-message-no-handler-was-ready-to-authenticate.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Bad Ansible Error Message - No handler was ready to authenticate
Jul 8, 2019
Of all the multitude of sins that software engineers wreak upon the world, I have a personal hatred for crappy error messages. Crappy error messages are an unforgivable sin that condemn all the people that ever get the error message to waste inordinate amounts of time on thinking, tinkering, google and more. Here is my command:
python /etc/ansible/inventory/ec2.py --list
What this is doing is executing the Ansible ec2.py script which talks to AWS and returns a list of resources. And here is today's favorite crappy error message:
Traceback (most recent call last):
File "/etc/ansible/inventory/ec2.py", line 1701, in <module>
Ec2Inventory()
File "/etc/ansible/inventory/ec2.py", line 272, in __init__
self.do_api_calls_update_cache()
File "/etc/ansible/inventory/ec2.py", line 539, in do_api_calls_update_cache
self.get_instances_by_region(region)
File "/etc/ansible/inventory/ec2.py", line 593, in get_instances_by_region
conn = self.connect(region)
File "/etc/ansible/inventory/ec2.py", line 557, in connect
conn = self.connect_to_aws(ec2, region)
File "/etc/ansible/inventory/ec2.py", line 582, in connect_to_aws
conn = module.connect_to_region(region, **connect_args)
File "/var/lib/jenkins/.local/lib/python2.7/site-packages/boto/ec2/__init__.py", line 66, in connect_to_region
connection_cls=EC2Connection, **kw_params)
File "/var/lib/jenkins/.local/lib/python2.7/site-packages/boto/regioninfo.py", line 220, in connect
return region.connect(**kw_params)
File "/var/lib/jenkins/.local/lib/python2.7/site-packages/boto/regioninfo.py", line 290, in connect
return self.connection_cls(region=self, **kw_params)
File "/var/lib/jenkins/.local/lib/python2.7/site-packages/boto/ec2/connection.py", line 103, in __init__
profile_name=profile_name)
File "/var/lib/jenkins/.local/lib/python2.7/site-packages/boto/connection.py", line 1100, in __init__
provider=provider)
File "/var/lib/jenkins/.local/lib/python2.7/site-packages/boto/connection.py", line 569, in __init__
host, config, self.provider, self._required_auth_capability())
File "/var/lib/jenkins/.local/lib/python2.7/site-packages/boto/auth.py", line 1021, in get_auth_handler
'Check your credentials' % (len(names), str(names)))
boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV4Handler'] Check your credentials
jenkins@ip-172-31-19-205:/home/ubuntu$ sudo^C
jenkins@ip-172-31-19-205:/home/ubuntu$ mkdir ~/.aws
jenkins@ip-172-31-19-205:/home/ubuntu$ mkdir ~/.aws/credentials
jenkins@ip-172-31-19-205:/home/ubuntu$ rmdir ~/.aws/credentials
jenkins@ip-172-31-19-205:/home/ubuntu$ nano ~/.aws/credentials
jenkins@ip-172-31-19-205:/home/ubuntu$ python /etc/ansible/inventory/ec2.py --list
{
"_meta": {
"hostvars": {
"199.31.18.123": {
The trick here was reading enough of it to find "No handler was ready to authenticate." I discovered this while setting up a new Jenkins server and the error was that Ansible's AWS credentials hadn't yet been copied up the server in the directory:
/home/jenkins/.aws/credentials
Once I put them there this problem went away (another problem came up immediately but one down and N thousand to go).
Posted In: #ansible
Recommend
-
108
AWS IAM Authenticator for Kubernetes A tool to use AWS IAM credentials to authenticate to a Kubernetes cluster. The initial work on this tool was driven by Heptio. The project receives contributions from multiple community engineers and i...
-
77
在Android中主线程与子线程的通信十分重要,Google工程师为我们提供了Handler-Message机制来解决他们之间的交互问题。今天,我们就来简单理解Handler-Message机制的原理,在Java中简单模拟该机制。代码示例Github地址HandlerDemo首先,看一下简单流程图(不太专业...
-
46
In this guide, we'll be implementing token based authentication in our own node.js A.P.I. using JSON web tokens. Server initialization Developing our add user functionality Devel...
-
41
Growth & MarketingSeptember 22, 2020New channels to authenticate users: An onboarding flow with TelegramAna Vilar GarcíaMarketing Specialist...
-
17
Authenticate using Azure Active Directory tokens 11/03/2020 2 minutes to read To authenticate to Databricks REST APIs, you can use Azure Databricks personal access to...
-
13
supports two different ways of authenticating against an LDAP service: operating system libraries (aka Native LDAP) sasl...
-
15
How to Authenticate Kafka Using Kerberos (SASL), Spark, and Jupyter NotebookJuly 19th 2021 new story5
-
12
ADCSPwn A tool to escalate privileges in an active directory network by coercing authenticate from machine accounts (Petitpotam) and relaying to the certificate service. Usage Run ADCSPwn on your target n...
-
7
What is Error Handler Error handler is responsible of identifying and handling runtime issues. Express.js comes pre-configured with a built-in Error Handler by default. Error Handlers In ExpressJS🚀 W...
-
13
Member
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK