-
Notifications
You must be signed in to change notification settings - Fork 397
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
cloudfront_distribution_info summary fails with 'TypeError: CloudFrontFactsServiceManager.describe_cloudfront_property() takes 4 positional arguments but 5 were given' #1915
Comments
Files identified in the description: If these files are inaccurate, please update the |
Having the same issue. File "/var/folders/3v/9txpvy690d9fchgwc_v3dp0h0000gn/T/ansible_community.aws.cloudfront_distribution_info_payload_z3n81zfa/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloudfront_facts.py", line 166, in summary_get_origin_access_identity_list\nTypeError: CloudFrontFactsServiceManager.describe_cloudfront_property() takes 4 positional arguments but 5 were given\n", |
Having the same issue too. Looks like it's broken since version >6.0.0? |
I have the (almost) same error with aws.community version 5.4.0 Error here: |
the method is defined over at amazon.aws here https://github.com/ansible-collections/amazon.aws/blob/main/plugins/module_utils/cloudfront_facts.py#L124 Which seems a bit risky to me, as one could have a version of |
In fact a version missmatch was the cause for the issue. I had the versions
Installing version 5.4.0 for both fixed the issue. But other version combos might also work. It's just down to luck I guess. ;) |
The combo 6.3.0 / 6.5.0 also seems to work if you prefer to stay on newer versions. |
c.a 5.x.x required a.a >= 5 https://github.com/ansible-collections/community.aws/blob/stable-5/galaxy.yml#L12 |
Yes. I guess it's the upper limit that matters here (from community.aws perspective). |
stable-6: add upper limit for amazon.aws dependency SUMMARY Parts of community.aws breaks when amazon.aws version is to high ref: #1915 Reviewed-by: Mark Chappell
stable-7: add upper limit for amazon.aws dependency SUMMARY Parts of community.aws breaks when amazon.aws version is to high ref: #1915 Reviewed-by: Mark Chappell
I tried with different set of versions but still having the same error Tried with:
Getting traceback:
|
I cannot reproduce your error.
The function Maybe @abikouo got an idea?
|
Your Tried with your $ ansible-galaxy collection list
# /home/ec2-user/.ansible/collections/ansible_collections
Collection Version
--------------- -------
amazon.aws 7.2.0
community.aws 7.1.0
kubernetes.core 3.0.0
$ cat test_summary.yml
---
- hosts: localhost
tasks:
- name: test
community.aws.cloudfront_distribution_info:
summary: true
$ ansible-playbook test_summary.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [localhost] **********************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************
ok: [localhost]
TASK [test] ***************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: describe_cloudfront_property() takes 4 positional arguments but 5 were given
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/ec2-user/.ansible/tmp/ansible-tmp-1705588826.5443957-3243763-23136583234235/AnsiballZ_cloudfront_distribution_info.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/ec2-user/.ansible/tmp/ansible-tmp-1705588826.5443957-3243763-23136583234235/AnsiballZ_cloudfront_distribution_info.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/ec2-user/.ansible/tmp/ansible-tmp-1705588826.5443957-3243763-23136583234235/AnsiballZ_cloudfront_distribution_info.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.cloudfront_distribution_info', init_globals=dict(_module_fqn='ansible_collections.community.aws.plugins.modules.cloudfront_distribution_info', _modlib_path=modlib_path),\n File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_community.aws.cloudfront_distribution_info_payload_sezyw8_z/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution_info.py\", line 408, in <module>\n File \"/tmp/ansible_community.aws.cloudfront_distribution_info_payload_sezyw8_z/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution_info.py\", line 399, in main\n File \"/tmp/ansible_community.aws.cloudfront_distribution_info_payload_sezyw8_z/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloudfront_facts.py\", line 159, in summary\n File \"/tmp/ansible_community.aws.cloudfront_distribution_info_payload_sezyw8_z/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloudfront_facts.py\", line 167, in summary_get_origin_access_identity_list\nTypeError: describe_cloudfront_property() takes 4 positional arguments but 5 were given\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
PLAY RECAP ****************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 And below is the test with $ cat test_list_distrib.yml
---
- hosts: localhost
tasks:
- name: test
community.aws.cloudfront_distribution_info:
list_distributions: true
list_streaming_distributions: true
$ ansible-playbook test_list_distrib.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [localhost] **********************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************
ok: [localhost]
TASK [test] ***************************************************************************************************************************************************
ok: [localhost]
PLAY RECAP ****************************************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 |
This is still an issue. Playbook - name: Retrieve info about CloudFront
community.aws.cloudfront_distribution_info:
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
region: "{{ aws_region }}"
register: _cloudfront_distribution_info
tags: ["route53"] Error
Versions
|
Still happening with these versions: $ ansible-galaxy collection list | grep aws
amazon.aws 8.0.0
community.aws 8.0.0 |
I don't get it why the error is happen. summary_dict.update(self.summary_get_origin_access_identity_list())
|
I experienced the same issue and found out that it somehow works with "summary: false" and "list_distributions: true" |
@markuman yes the error happens in |
This is still an issue with version 9.0.0 of
|
Summary
I'm trying to get a summary of all cloudfront distributions. I.e.
The call fails with:
I tried to get the info with a single distribution (i.e. specify distribution: true and distribution_id instead of summary) and that works fine, so I assume that it's not a general issue with my ansible installation
Issue Type
Bug Report
Component Name
community.aws.cloudfront_info
Ansible Version
Collection Versions
AWS SDK versions
Configuration
$ ansible-config dump --only-changed
OS / Environment
Linux Mint
Steps to Reproduce
Expected Results
I expected the module to return a summary of all distributions
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: