Ansible 2.15 Warning message

505 views
Skip to first unread message

Dhirender Yadav

unread,
Aug 11, 2023, 8:34:34 AM8/11/23
to ansible...@googlegroups.com
Hi Team,

Recently we have upgraded to ansible 2.15 and we are getting below WARNINGS.

TASK [fail] *************************************************************************************************************************************************
[WARNING]: An unexpected error occurred during Jinja2 plugin loading: 'NoneType' object has no attribute '_original_path'

--

Regards,
Dhirender Yadav

Dick Visser

unread,
Aug 11, 2023, 8:45:36 AM8/11/23
to ansible...@googlegroups.com
That is very little information. 
How can we reproduce this issue?
Minimum playbook etc??


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACSTsYS6L-3SA-bZFnHF5t%3DcrCSyWywsELTW5vFS7%2BayGj5iGQ%40mail.gmail.com.
--
Sent from Gmail Mobile

Dhirender Yadav

unread,
Aug 16, 2023, 9:22:02 AM8/16/23
to ansible...@googlegroups.com
Hi Dick Visser,

Please find the below requested details:- 

-------------------------------------------------------------

-------------------------------------------------------------

:~$ ansible-galaxy collection list -p /home/test/

[DEPRECATION WARNING]: DEFAULT_GATHER_SUBSET option, the module_defaults keyword is a more generic version and can apply to all calls to the M(ansible.builtin.gather_facts) or M(ansible.builtin.setup) actions, use module_defaults

instead. This feature will be removed from ansible-core in version 2.18. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.


# /home/test/ansible_collections

Collection Version

----------------- -------

ansible.posix 1.5.4

ansible.utils 2.10.3

community.general 4.6.1

:~$

:~$ ansible --version

ansible-playbook [core 2.15.2]

config file = /home/test/ansible.cfg

configured module search path = ['/home/test/modules']

ansible python module location = /usr/local/lib/python3.9/site-packages/ansible

ansible collection location = /home/test

executable location = /usr/local/bin/ansible-playbook

python version = 3.9.16 (main, Dec 21 2022, 10:57:18) [GCC 8.5.0 20210514 (Red Hat 8.5.0-17)] (/usr/bin/python3.9)

jinja version = 3.1.2

libyaml = False

-------------------------------------------------------------

-------------------------------------------------------------  


-------------------------------------------------------------

-------------------------------------------------------------

:~$ cat test.yml

---

- name: Fail test

hosts: localhost

any_errors_fatal: true

vars:

CASSANDRA:

distribution: dse

pre_tasks:

- fail:

msg: "Cassandra distribution '{{ CASSANDRA.distribution|d(distribution) }}' is not valid"

when:

- CASSANDRA.distribution|d(distribution) not in ('dse', 'apache_cassandra')

- '"test" not in ansible_run_tags'

tasks:

- debug: msg="{{ CASSANDRA.distribution }}"

-------------------------------------------------------------

-------------------------------------------------------------


-------------------------------------------------------------
-------------------------------------------------------------
:~$ ansible-playbook test.yml -vv
ansible-playbook [core 2.15.2]
  config file = /home/test/ansible.cfg
  configured module search path = ['/home/test/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/test
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.9.16 (main, Dec 21 2022, 10:57:18) [GCC 8.5.0 20210514 (Red Hat 8.5.0-17)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = False
Using /home/test/ansible.cfg as config file
[DEPRECATION WARNING]: DEFAULT_GATHER_SUBSET option, the module_defaults keyword is a more generic version and can apply to all calls to the M(ansible.builtin.gather_facts) or M(ansible.builtin.setup) actions, use module_defaults
instead. This feature will be removed from ansible-core in version 2.18. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: Skipping plugin (/usr/local/lib/python3.9/site-packages/ansible/plugins/callback/selective.py), cannot load: cannot import name 'codeCodes' from 'ansible.utils.color' (/usr/local/lib/python3.9/site-
packages/ansible/utils/color.py)
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
Skipping callback 'actionable', as we already have a stdout callback.
Skipping callback 'counter_enabled', as we already have a stdout callback.
Skipping callback 'debug', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'full_skip', as we already have a stdout callback.
Skipping callback 'json', as we already have a stdout callback.
Skipping callback 'null', as we already have a stdout callback.
Skipping callback 'skippy', as we already have a stdout callback.
Skipping callback 'stderr', as we already have a stdout callback.
Skipping callback 'unixy', as we already have a stdout callback.
Skipping callback 'yaml', as we already have a stdout callback.

PLAYBOOK: test.yml **************************************************************************************************************************************************************************************************************************
1 plays in test.yml

PLAY [Fail test] ****************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
task path: /home/test/test.yml:2
ok: [localhost]

TASK [fail] *********************************************************************************************************************************************************************************************************************************
task path: /home/test/test.yml:9
redirecting (type: filter) ansible.builtin.ipaddr to ansible.netcommon.ipaddr


[WARNING]: An unexpected error occurred during Jinja2 plugin loading: 'NoneType' object has no attribute '_original_path'

redirecting (type: filter) ansible.builtin.ipaddr to ansible.netcommon.ipaddr
redirecting (type: filter) ansible.builtin.ipaddr to ansible.netcommon.ipaddr
redirecting (type: filter) ansible.builtin.ipaddr to ansible.netcommon.ipaddr
redirecting (type: filter) ansible.builtin.ipaddr to ansible.netcommon.ipaddr
skipping: [localhost] => {"changed": false, "false_condition": "CASSANDRA.distribution|d(distribution) not in ('dse', 'apache_cassandra')", "skip_reason": "Conditional result was False"}

TASK [debug] ********************************************************************************************************************************************************************************************************************************
task path: /home/test/test.yml:15
ok: [localhost] => {
    "msg": "dse"
}

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0
-------------------------------------------------------------
-------------------------------------------------------------


In the ansible logs you will able to see the below message:-

[WARNING]: An unexpected error occurred during Jinja2 plugin loading: 'NoneType' object has no attribute '_original_path'

redirecting (type: filter) ansible.builtin.ipaddr to ansible.netcommon.ipaddr


Can you please help with this ?




--

Regards,
Dhirender Yadav

Dhirender Yadav

unread,
Aug 17, 2023, 11:02:00 AM8/17/23
to ansible...@googlegroups.com
Hi Team,

Recently we have upgraded to ansible 2.15 and we are getting below WARNINGS.

Please find the below for the ansible version and collection installed.

~$ ansible-galaxy collection list -p /home/test/

[DEPRECATION WARNING]: DEFAULT_GATHER_SUBSET option, the module_defaults keyword is a more generic version and can apply to all calls to the M(ansible.builtin.gather_facts) or M(ansible.builtin.setup) actions, use module_defaults

instead. This feature will be removed from ansible-core in version 2.18. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.


# /home/test/ansible_collections

Collection Version

----------------- -------

ansible.posix 1.5.4

ansible.utils 2.10.3

community.general 4.6.1

:~$

:~$ ansible --version

ansible-playbook [core 2.15.2]

config file = /home/test/ansible.cfg

configured module search path = ['/home/test/modules']

ansible python module location = /usr/local/lib/python3.9/site-packages/ansible

ansible collection location = /home/test

executable location = /usr/local/bin/ansible-playbook

python version = 3.9.16 (main, Dec 21 2022, 10:57:18) [GCC 8.5.0 20210514 (Red Hat 8.5.0-17)] (/usr/bin/python3.9)

jinja version = 3.1.2

libyaml = False


Ansible playbook used for the testing:

:~$ cat test.yml

---

- name: Fail test

hosts: localhost

any_errors_fatal: true

vars:

CASSANDRA:

distribution: dse

pre_tasks:

- fail:

msg: "Cassandra distribution '{{ CASSANDRA.distribution|d(distribution) }}' is not valid"

when:

- CASSANDRA.distribution|d(distribution) not in ('dse', 'apache_cassandra')

- '"test" not in ansible_run_tags'

tasks:

- debug: msg="{{ CASSANDRA.distribution }}"

--

Ansible logs 

Can you please help with this issue ?

Regards,
Dhirender Yadav

Dhirender Yadav

unread,
Sep 5, 2023, 11:25:55 PM9/5/23
to ansible...@googlegroups.com
Hi  Team,

Can someone help with this issue ?
--

Regards,
Dhirender Yadav

Felix Fontein

unread,
Sep 6, 2023, 1:19:32 AM9/6/23
to ansible...@googlegroups.com
Hi,

I think it would help if you would say which specific message do you
mean. There are a lot of different messages in what you posted.

Cheers,
Felix

Brian Coca

unread,
Sep 6, 2023, 10:06:33 AM9/6/23
to ansible...@googlegroups.com
The first warning seems like a deprecation, which you should be able
to check via `ansible-config dump --only-changed`.
The 2nd warning seems due to a ansible-core vs selective callback
plugin version mismatch.
The 3rd is probably also a version incompatibility, but for the
ansible.netcommon collection. I would open an issue in here
https://github.com/ansible-collections/ansible.netcommon/issues

--
----------
Brian Coca

Reply all
Reply to author
Forward
0 new messages