Repository navigation
Closed
Labels
modulemodulemodulepluginsplugin (any type)plugin (any type)priority/lowpython3tracebackwaiting_on_contributorNeeds help. Feel free to engage to get things unblockedNeeds help. Feel free to engage to get things unblocked
Description
SUMMARY
We are using CodeBuild service to build our product. In that process, we are using Ansible module to create an AMI image from AppServer instance. Since the AMI creation taking more time the AMI status check API request getting expire after 15 minutes.
ISSUE TYPE
COMPONENT NAME
/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/ansible_collections/amazon/aws/plugins/modules/ec2_ami.py
ANSIBLE VERSION
ansible 2.10.5
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/ansible
executable location = /root/.pyenv/versions/3.8.3/bin/ansible
python version = 3.8.3
##### CONFIGURATION
##### OS / ENVIRONMENT
Linux(Ubuntu 18.04.5 LTS)
##### STEPS TO REPRODUCE
If the AMI creation steps taking more than 15 mins this error occurs.
##### EXPECTED RESULTS
It should wait until the AMI gets created and once the AMI status is available then it should proceed further.
##### ACTUAL RESULTS
TASK [Create AMI snapshot of app host] *****************************************
task path: /make_ami/ansible/snapshot-ec2-ami.yml:36
redirecting (type: modules) ansible.builtin.ec2_ami to amazon.aws.ec2_ami
Using module file /root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/ansible_collections/amazon/aws/plugins/modules/ec2_ami.py
Pipelining is enabled.
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c '/root/.pyenv/versions/3.8.3/bin/python && sleep 0'
The full traceback is:
Traceback (most recent call last):
File "<stdin>", line 102, in <module>
File "<stdin>", line 94, in _ansiballz_main
File "<stdin>", line 40, in invoke_module
File "/root/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/root/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/root/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_ec2_ami_payload_qno0haa5/ansible_ec2_ami_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_ami.py", line 761, in <module>
File "/tmp/ansible_ec2_ami_payload_qno0haa5/ansible_ec2_ami_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_ami.py", line 757, in main
File "/tmp/ansible_ec2_ami_payload_qno0haa5/ansible_ec2_ami_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_ami.py", line 511, in create_image
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/botocore/waiter.py", line 310, in wait
raise WaiterError(
botocore.exceptions.WaiterError: Waiter image_available failed: Request has expired.
fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"<stdin>\", line 102, in <module>\n File \"<stdin>\", line 94, in _ansiballz_main\n File \"<stdin>\", line 40, in invoke_module\n File \"/root/.pyenv/versions/3.8.3/lib/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/root/.pyenv/versions/3.8.3/lib/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/root/.pyenv/versions/3.8.3/lib/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_ec2_ami_payload_qno0haa5/ansible_ec2_ami_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_ami.py\", line 761, in <module>\n File \"/tmp/ansible_ec2_ami_payload_qno0haa5/ansible_ec2_ami_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_ami.py\", line 757, in main\n File \"/tmp/ansible_ec2_ami_payload_qno0haa5/ansible_ec2_ami_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_ami.py\", line 511, in create_image\n File \"/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/botocore/waiter.py\", line 310, in wait\n raise WaiterError(\nbotocore.exceptions.WaiterError: Waiter image_available failed: Request has expired.\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
Metadata
Metadata
Assignees
Labels
modulemodulemodulepluginsplugin (any type)plugin (any type)priority/lowpython3tracebackwaiting_on_contributorNeeds help. Feel free to engage to get things unblockedNeeds help. Feel free to engage to get things unblocked
Activity
ansibullbot commentedon Jan 27, 2021
Files identified in the description:
plugins/modules/ec2_ami.py](https://github.com/['ansible-collections/amazon.aws', 'ansible-collections/community.aws', 'ansible-collections/community.vmware']/blob/main/plugins/modules/ec2_ami.py)If these files are inaccurate, please update the
component namesection of the description or use the!componentbot command.click here for bot help
ansibullbot commentedon Jan 27, 2021
cc @Constantin07 @gunzy83 @jillr @s-hertel @scicoin-project @tremble @wilvk @wimnat
click here for bot help
gravesm commentedon Jan 29, 2021
@sureshkumarp0 Could you confirm if you are using a
wait_timeoutin your task, and if so, how long?tremble commentedon May 5, 2021
A quick search using Google seems to imply that the most common cause of this error is expired session tokens. The alternative would be the botocore waiter code not updating the timestamp on the requests it makes, and would be a bug in botocore, not this module.
See for example hashicorp/packer#8299
Since neither of these scenarios are something we can/should realistically handle, and we've heard nothing from you since January I'm going to close this issue.
Add lightsail_static_ip module (ansible-collections#259)
Add lightsail_static_ip module (ansible-collections#259)
Add lightsail_static_ip module (ansible-collections#259)