botocore.exceptions.NoCredentialsError

201 views
Skip to first unread message

Brati Acharya

unread,
Feb 15, 2021, 2:35:07 PM2/15/21
to Ansible Project
Hi 

Any idea on the below error?

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.NoCredentialsError: Unable to locate credentials
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1612176347.5235934-25105931528250/AnsiballZ_elasticbeanstalk_app.py\", line 114, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1612176347.5235934-25105931528250/AnsiballZ_elasticbeanstalk_app.py\", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1612176347.5235934-25105931528250/AnsiballZ_elasticbeanstalk_app.py\", line 49, in invoke_module\n imp.load_module('__main__', mod, module, MOD_DESC)\n File \"/usr/local/lib/python3.6/imp.py\", line 235, in load_module\n return load_source(name, filename, file)\n File \"/usr/local/lib/python3.6/imp.py\", line 170, in load_source\n module = _exec(spec, sys.modules[name])\n File \"<frozen importlib._bootstrap>\", line 618, in _exec\n File \"<frozen importlib._bootstrap_external>\", line 678, in exec_module\n File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n File \"/tmp/ansible_elasticbeanstalk_app_payload_f9hju946/__main__.py\", line 206, in <module>\n File \"/tmp/ansible_elasticbeanstalk_app_payload_f9hju946/__main__.py\", line 169, in main\n File \"/tmp/ansible_elasticbeanstalk_app_payload_f9hju946/__main__.py\", line 104, in describe_app\n File \"/tmp/ansible_elasticbeanstalk_app_payload_f9hju946/__main__.py\", line 110, in list_apps\n File \"/usr/local/lib/python3.6/site-packages/botocore/client.py\", line 357, in _api_call\n return self._make_api_call(operation_name, kwargs)\n File \"/usr/local/lib/python3.6/site-packages/botocore/client.py\", line 663, in _make_api_call\n operation_model, request_dict, request_context)\n File \"/usr/local/lib/python3.6/site-packages/botocore/client.py\", line 682, in _make_request\n return self._endpoint.make_request(operation_model, request_dict)\n File \"/usr/local/lib/python3.6/site-packages/botocore/endpoint.py\", line 102, in make_request\n return self._send_request(request_dict, operation_model)\n File \"/usr/local/lib/python3.6/site-packages/botocore/endpoint.py\", line 132, in _send_request\n request = self.create_request(request_dict, operation_model)\n File \"/usr/local/lib/python3.6/site-packages/botocore/endpoint.py\", line 116, in create_request\n operation_name=operation_model.name)\n File \"/usr/local/lib/python3.6/site-packages/botocore/hooks.py\", line 356, in emit\n return self._emitter.emit(aliased_event_name, **kwargs)\n File \"/usr/local/lib/python3.6/site-packages/botocore/hooks.py\", line 228, in emit\n return self._emit(event_name, kwargs)\n File \"/usr/local/lib/python3.6/site-packages/botocore/hooks.py\", line 211, in _emit\n response = handler(**kwargs)\n File \"/usr/local/lib/python3.6/site-packages/botocore/signers.py\", line 90, in handler\n return self.sign(operation_name, request)\n File \"/usr/local/lib/python3.6/site-packages/botocore/signers.py\", line 162, in sign\n auth.add_auth(request)\n File \"/usr/local/lib/python3.6/site-packages/botocore/auth.py\", line 357, in add_auth\n raise NoCredentialsError\nbotocore.exceptions.NoCredentialsError: Unable to locate credentials\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Gaurav Gupta

unread,
Feb 15, 2021, 9:54:08 PM2/15/21
to Ansible Project
This issue is because of you didn't provide aws credentials.
So first provide credentials either by awscli tool or using environmental variables.
By awscli tool, run these two command in terminal..
#pip3 install awscli
#aws configure
As you run 2nd command, it ask for access key, secret key etc. 
Give those and run your fille again.
Hope this help...
Reply all
Reply to author
Forward
0 new messages