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

diff mode + assemble + remote_src=false raises fatal error #83123

Closed
1 task done
jautz opened this issue Apr 23, 2024 · 3 comments
Closed
1 task done

diff mode + assemble + remote_src=false raises fatal error #83123

jautz opened this issue Apr 23, 2024 · 3 comments
Assignees
Labels
affects_2.16 bug This issue/PR relates to a bug. module This issue/PR relates to a module. verified This issue has been verified/reproduced by maintainer

Comments

@jautz
Copy link

jautz commented Apr 23, 2024

Summary

A fatal error is raised with recent Ansible versions (2.16+) when

  • the playbook is run with the --diff option.
  • the assemble module is run with remote_src: false

Issue Type

Bug Report

Component Name

assemble

Ansible Version

$ ansible --version
ansible [core 2.16.5]
  config file = /home/jjautz/src/git/ansible-playground/ansible.cfg
  configured module search path = ['/home/jjautz/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/jjautz/.venv/ansible-2-16-5/lib/python3.11/site-packages/ansible
  ansible collection location = /home/jjautz/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/jjautz/.venv/ansible-2-16-5/bin/ansible
  python version = 3.11.8 (main, Feb  7 2024, 21:52:08) [GCC 13.2.0] (/home/jjautz/.venv/ansible-2-16-5/bin/python3)
  jinja version = 3.1.3
  libyaml = True

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
CALLBACKS_ENABLED(env: ANSIBLE_CALLBACKS_ENABLED) = ['profile_tasks']
CONFIG_FILE() = /home/jjautz/src/git/ansible-playground/ansible.cfg
DEFAULT_GATHERING(env: ANSIBLE_GATHERING) = explicit
DEFAULT_HOST_LIST(/home/jjautz/src/git/ansible-playground/ansible.cfg) = ['/home/jjautz/src/git/ansible-playground/inventory.ini']
DEFAULT_LOG_PATH(env: ANSIBLE_LOG_PATH) = /run/user/1000/log/ansible/stdout
DEFAULT_STDOUT_CALLBACK(env: ANSIBLE_STDOUT_CALLBACK) = yaml
DEFAULT_TIMEOUT(env: ANSIBLE_TIMEOUT) = 20
EDITOR(env: EDITOR) = vi
PAGER(env: PAGER) = less
RETRY_FILES_ENABLED(env: ANSIBLE_RETRY_FILES_ENABLED) = False

CONNECTION:
==========

paramiko_ssh:
____________
timeout(env: ANSIBLE_TIMEOUT) = 20

ssh:
___
timeout(env: ANSIBLE_TIMEOUT) = 20

OS / Environment

Debian GNU/Linux (testing + stable)

Steps to Reproduce

Please refer to the branch assemble_diff_ex of my "ansible-playground" repository:
https://github.com/jautz/ansible-playground/tree/assemble_diff_ex

There's a readme and a minimal playbook that demonstrates the issue.

Expected Results

An assembled result file was expected.

Actual Results

### Using this playbook:
### https://github.com/jautz/ansible-playground/tree/assemble_diff_ex

$ ansible-playbook site.yml --diff
[...]

TASK [assemble local src] *****************************************************
Monday 22 April 2024  17:51:36 +0200 (0:00:00.184)       0:00:00.516 **********
[...]
The full traceback is:
Traceback (most recent call last):
  File "/home/jjautz/.venv/ansible-2-16-5/lib/python3.11/site-packages/ansible/executor/task_executor.py", line 165, in run
    res = self._execute()
          ^^^^^^^^^^^^^^^
  File "/home/jjautz/.venv/ansible-2-16-5/lib/python3.11/site-packages/ansible/executor/task_executor.py", line 637, in _execute
    result = self._handler.run(task_vars=vars_copy)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jjautz/.venv/ansible-2-16-5/lib/python3.11/site-packages/ansible/plugins/action/assemble.py", line 144, in run
    diff = self._get_diff_data(dest, path, task_vars)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ActionBase._get_diff_data() missing 1 required positional argument: 'content'
fatal: [localhost]: FAILED! =>
  msg: 'Unexpected failure during module execution: ActionBase._get_diff_data() missing 1 required positional argument: ''content'''
  stdout: ''

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. affects_2.16 module This issue/PR relates to a module. labels Apr 23, 2024
@ansibot
Copy link
Contributor

ansibot commented Apr 23, 2024

Files identified in the description:

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

@mkrizek mkrizek added needs_verified This issue needs to be verified/reproduced by maintainer and removed needs_triage Needs a first human triage before being processed. labels Apr 23, 2024
@jautz
Copy link
Author

jautz commented Apr 23, 2024

Sorry folks for the noise.
I think this has been fixed in the following commit but the code has not been released, yet.
7f2ad7e
It has the v2.17.0b1 label. So I will close this for now.

@jautz jautz closed this as completed Apr 23, 2024
@mkrizek
Copy link
Contributor

mkrizek commented Apr 23, 2024

We created a backport of this to 2.16 - #83124

@Akasurde Akasurde self-assigned this Apr 23, 2024
@Akasurde Akasurde added verified This issue has been verified/reproduced by maintainer and removed needs_verified This issue needs to be verified/reproduced by maintainer labels Apr 23, 2024
@ansible ansible locked and limited conversation to collaborators May 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.16 bug This issue/PR relates to a bug. module This issue/PR relates to a module. verified This issue has been verified/reproduced by maintainer
Projects
None yet
Development

No branches or pull requests

4 participants