Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure in last version #1083

Closed
1 task done
ofirhazam opened this issue Sep 15, 2022 · 5 comments · Fixed by #1086
Closed
1 task done

failure in last version #1083

ofirhazam opened this issue Sep 15, 2022 · 5 comments · Fixed by #1086
Labels

Comments

@ofirhazam
Copy link

Summary

when I try

  • name: Gather reporter NLB info
    community.aws.elb_application_lb_info:
    region: "{{aws_region}}"
    names: "{{ott_ad_reporter_nlb}}"
    it fails

TASK [ott-ad-reporter : Gather reporter NLB info] **********************************************************************************************************************************************************
task path: /etc/ansible/roles/ott-ad-reporter/tasks/route53.yml:22
ESTABLISH LOCAL CONNECTION FOR USER: root
EXEC /bin/sh -c 'echo ~root && sleep 0'
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp"&& mkdir /root/.ansible/tmp/ansible-tmp-1663248899.0955095-2850-167154524939328 && echo ansible-tmp-1663248899.0955095-2850-167154524939328="echo /root/.ansible/tmp/ansible-tmp-1663248899.0955095-2850-167154524939328" ) && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1663248899.0955095-2850-167154524939328/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 147, in run
res = self._execute()
File "/usr/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 660, in _execute
result = self._handler.run(task_vars=variables)
File "/usr/lib/python3.8/site-packages/ansible/plugins/action/normal.py", line 46, in run
result = merge_hash(result, self._execute_module(task_vars=task_vars, wrap_async=wrap_async))
File "/usr/lib/python3.8/site-packages/ansible/plugins/action/init.py", line 825, in _execute_module
(module_style, shebang, module_data, module_path) = self._configure_module(module_name=module_name, module_args=module_args, task_vars=task_vars)
File "/usr/lib/python3.8/site-packages/ansible/plugins/action/init.py", line 206, in _configure_module
(module_data, module_style, module_shebang) = modify_module(module_name, module_path, module_args, self._templar,
File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 1250, in modify_module
(b_module_data, module_style, shebang) = _find_module_utils(module_name, b_module_data, module_path, module_args, task_vars, templar, module_compression,
File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 1089, in _find_module_utils
recursive_finder(module_name, remote_module_fqn, b_module_data, py_module_names,
File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 725, in recursive_finder
module_info = CollectionModuleInfo(py_module_name[-idx],
File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 645, in init
self.get_source()
File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 661, in get_source
data = pkgutil.get_data(to_native(self._package_name), to_native(self._mod_name + '.py'))
File "/usr/lib/python3.8/pkgutil.py", line 619, in get_data
spec = importlib.util.find_spec(package)
File "/usr/lib/python3.8/importlib/util.py", line 114, in find_spec
raise ValueError('{}.spec is None'.format(name))
ValueError: ansible_collections.amazon.aws.plugins.module_utils.core.spec is None
fatal: [localhost]: FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}

Issue Type

Bug Report

Component Name

community.aws.elb_application_lb_info

Ansible Version

$ ansible --version

Collection Versions

$ ansible-galaxy collection list

AWS SDK versions

$ pip show boto boto3 botocore

Configuration

$ ansible-config dump --only-changed

DEFAULT_HASH_BEHAVIOUR(env: ANSIBLE_HASH_BEHAVIOUR) = merge

OS / Environment

3.12.0
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.12.0
PRETTY_NAME="Alpine Linux v3.12"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

Steps to Reproduce

- name: Gather reporter NLB info
      community.aws.elb_application_lb_info:
        region: "{{aws_region}}"
        names: "{{ott_ad_reporter_nlb}}"

Expected Results

works as previous version

Actual Results

task path: /etc/ansible/roles/ott-ad-reporter/tasks/route53.yml:51
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir /root/.ansible/tmp/ansible-tmp-1663248962.4154537-2898-266156996967621 && echo ansible-tmp-1663248962.4154537-2898-266156996967621="` echo /root/.ansible/tmp/ansible-tmp-1663248962.4154537-2898-266156996967621 `" ) && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1663248962.4154537-2898-266156996967621/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 147, in run
    res = self._execute()
  File "/usr/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 660, in _execute
    result = self._handler.run(task_vars=variables)
  File "/usr/lib/python3.8/site-packages/ansible/plugins/action/normal.py", line 46, in run
    result = merge_hash(result, self._execute_module(task_vars=task_vars, wrap_async=wrap_async))
  File "/usr/lib/python3.8/site-packages/ansible/plugins/action/__init__.py", line 825, in _execute_module
    (module_style, shebang, module_data, module_path) = self._configure_module(module_name=module_name, module_args=module_args, task_vars=task_vars)
  File "/usr/lib/python3.8/site-packages/ansible/plugins/action/__init__.py", line 206, in _configure_module
    (module_data, module_style, module_shebang) = modify_module(module_name, module_path, module_args, self._templar,
  File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 1250, in modify_module
    (b_module_data, module_style, shebang) = _find_module_utils(module_name, b_module_data, module_path, module_args, task_vars, templar, module_compression,
  File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 1089, in _find_module_utils
    recursive_finder(module_name, remote_module_fqn, b_module_data, py_module_names,
  File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 725, in recursive_finder
    module_info = CollectionModuleInfo(py_module_name[-idx],
  File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 645, in __init__
    self.get_source()
  File "/usr/lib/python3.8/site-packages/ansible/executor/module_common.py", line 661, in get_source
    data = pkgutil.get_data(to_native(self._package_name), to_native(self._mod_name + '.py'))
  File "/usr/lib/python3.8/pkgutil.py", line 619, in get_data
    spec = importlib.util.find_spec(package)
  File "/usr/lib/python3.8/importlib/util.py", line 114, in find_spec
    raise ValueError('{}.__spec__ is None'.format(name))
ValueError: ansible_collections.amazon.aws.plugins.module_utils.core.__spec__ is None
fatal: [localhost]: FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug needs_triage python3 traceback labels Sep 15, 2022
@alinabuzachis alinabuzachis transferred this issue from ansible-collections/community.aws Sep 28, 2022
@tremble
Copy link
Contributor

tremble commented Sep 28, 2022

CC: @briantist

This is apparently caused by #951

Specifically the import ansible.module_utils.common.warnings as ansible_warnings (looks like this isn't available in Ansible 2.9) The simplest fix is to upgrade to at least Ansible 2.10

Given that 2.9 is no longer supported upstream I think it's time to drop any claims that we support it in the collection, things like this are only going to get worse if we try to support too many versions of Ansible.

@alinabuzachis @jillr

tremble added a commit to tremble/amazon.aws that referenced this issue Sep 28, 2022
tremble added a commit to tremble/amazon.aws that referenced this issue Sep 28, 2022
tremble added a commit to tremble/amazon.aws that referenced this issue Sep 28, 2022
tremble added a commit to tremble/amazon.aws that referenced this issue Sep 28, 2022
@briantist
Copy link
Contributor

Specifically the import ansible.module_utils.common.warnings as ansible_warnings (looks like this isn't available in Ansible 2.9) The simplest fix is to upgrade to at least Ansible 2.10

Given that 2.9 is no longer supported upstream I think it's time to drop any claims that we support it in the collection, things like this are only going to get worse if we try to support too many versions of Ansible.

This should've been caught in tests. If we're not testing against Ansible 2.9 anymore, then it absolutely should be officially unsupported and removed from meta/runtime.yml and any other areas (I assumed that was already the case since it went EoL).

Thanks for tracking this down @tremble !

softwarefactory-project-zuul bot pushed a commit that referenced this issue Sep 29, 2022
Work around for #1083

SUMMARY
The collection currently doesn't run on Ansible 2.9 (which we say we test against).
fixes: #1083
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/module_utils/cloud.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
patchback bot pushed a commit that referenced this issue Sep 29, 2022
Work around for #1083

SUMMARY
The collection currently doesn't run on Ansible 2.9 (which we say we test against).
fixes: #1083
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/module_utils/cloud.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
(cherry picked from commit e0aeafd)
softwarefactory-project-zuul bot pushed a commit that referenced this issue Sep 29, 2022
[PR #1086/e0aeafdc backport][stable-4] Work around for #1083

This is a backport of PR #1086 as merged into main (e0aeafd).
SUMMARY
The collection currently doesn't run on Ansible 2.9 (which we say we test against).
fixes: #1083
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/module_utils/cloud.py
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell <None>
softwarefactory-project-zuul bot pushed a commit that referenced this issue Sep 29, 2022
Drop support for Ansible Core < 2.11

SUMMARY
We only perform integration tests against milestone.  And we only perform sanity tests against 2.12+.  Ansible Core  2.11 goes out of support in November
Trying to maintain support for Ansible 2.9 is only going to get more painful as time goes on, as demonstrated by #1083.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
meta/runtime.yml
ADDITIONAL INFORMATION
Dropping support for 2.9/2.10 puts us in line with Ansible Core, community.general and community.network.
Additionally:

AAP 1.2 (based on 2.9) is in "Maintenance support 2" bugs and security fixes only (https://access.redhat.com/support/policy/updates/ansible-automation-platform), which we can support by backporting fixes if necessary
Later versions of AAP support ee-2.9, however ee-2.9 is only supported for "the Ansible Core RPMs" which would mean backports
Ansible Tower is in "Maintenance support 2" bugs and security fixes only (https://access.redhat.com/support/policy/updates/ansible-tower), with support ending in November which we can support by backporting fixes if necessary.
Ansible Engine 2.9 support has ended already (https://access.redhat.com/support/policy/updates/ansible-engine)

Reviewed-by: Jill R <None>
tremble added a commit to tremble/amazon.aws that referenced this issue Sep 30, 2022
softwarefactory-project-zuul bot pushed a commit that referenced this issue Sep 30, 2022
Revert "Work around for #1083 (#1086)"

This reverts commit e0aeafd.
SUMMARY
Following #1087 we no longer need the workaround for #1083.
The work around has been backported to stable-4, which still announces support for Ansible 2.9, however we've now dropped support for 2.9 so don't need this in main/5.0.0
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/module_utils/cloud.py
ADDITIONAL INFORMATION

Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
@RobertFr0st
Copy link

It may also be a good idea to update the changelog to reflect when the compatibility with ansible 2.9 was broken. I was dealing with a similar issue with community.general and this thread helped me to narrow down that it was the same problem happening with this amazon.aws module. In my case locking the collection version down to 3.4.0 resolved the issue.

@tremble
Copy link
Contributor

tremble commented Oct 6, 2022

@RobertFr0st,

Compatibility with 2.9 was accidentally broken in 4.2.0 (it should work with 4.1.0), and a fix will be available when we release 4.3.0 (we're trying to finish off the 5.0.0 releases first, which took longer than intended)

Compatibility with Ansible Core < 2.11 was deliberately broken with 5.0.0 including a release note
https://ansible-collections.github.io/amazon.aws/tag/5.0.0/collections/amazon/aws/docsite/CHANGELOG.html#release-summary

In this release we promoted many community modules to Red Hat supported status. Those modules have been moved from the commuity.aws to amazon.aws collection. This release also brings some new features, bugfixes, breaking changes and deprecated features. The amazon.aws collection has dropped support for botocore<1.21.0 and boto3<1.18.0. Support for ansible-core<2.11 has also been dropped.

and a breaking changes changelog entry
https://ansible-collections.github.io/amazon.aws/tag/5.0.0/collections/amazon/aws/docsite/CHANGELOG.html#breaking-changes-porting-guide

amazon.aws collection - Support for ansible-core < 2.11 has been dropped (#1087).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants