You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
juniper.device.facts with config_format: "json" with persistent connection juniper.device.pyez fails with ConnectionError: Type 'dict' cannot be serialized.\n"
#690
Open
chidanandpujar opened this issue
Aug 28, 2024
· 0 comments
juniper.device.facts with config_format: "json" with persistent connection juniper.device.pyez fails with error ansible.module_utils.connection.ConnectionError: Type 'dict' cannot be serialized.\n"
The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-local-39711jk7by9dc/ansible-tmp-1724827191.4637392-39715-113525380193049/AnsiballZ_facts.py", line 107, in <module>
_ansiballz_main()
File "/root/.ansible/tmp/ansible-local-39711jk7by9dc/ansible-tmp-1724827191.4637392-39715-113525380193049/AnsiballZ_facts.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-local-39711jk7by9dc/ansible-tmp-1724827191.4637392-39715-113525380193049/AnsiballZ_facts.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.juniper.device.plugins.modules.facts', init_globals=dict(_module_fqn='ansible_collections.juniper.device.plugins.modules.facts', _modlib_path=modlib_path),
File "<frozen runpy>", line 226, in run_module
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py", line 367, in <module>
File "/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py", line 349, in main
File "/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 1302, in get_configuration
File "/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 1784, in get_config
File "/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible/module_utils/connection.py", line 199, in __rpc__
ansible.module_utils.connection.ConnectionError: Type 'dict' cannot be serialized.
fatal: [pyezconnectiontestcases]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-local-39711jk7by9dc/ansible-tmp-1724827191.4637392-39715-113525380193049/AnsiballZ_facts.py\", line 107, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-local-39711jk7by9dc/ansible-tmp-1724827191.4637392-39715-113525380193049/AnsiballZ_facts.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-local-39711jk7by9dc/ansible-tmp-1724827191.4637392-39715-113525380193049/AnsiballZ_facts.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.juniper.device.plugins.modules.facts', init_globals=dict(_module_fqn='ansible_collections.juniper.device.plugins.modules.facts', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py\", line 367, in <module>\n File \"/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py\", line 349, in main\n File \"/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py\", line 1302, in get_configuration\n File \"/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py\", line 1784, in get_config\n File \"/tmp/ansible_juniper.device.facts_payload_2sh9bd_v/ansible_juniper.device.facts_payload.zip/ansible/module_utils/connection.py\", line 199, in __rpc__\nansible.module_utils.connection.ConnectionError: Type 'dict' cannot be serialized.\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
Steps to reproduce
---
- name: Get device facts and configuration
hosts: all
connection: local
gather_facts: no
tasks:
- name: Retrieve device facts and configuration and save facts to file
juniper.device.facts:
savedir: "{{ playbook_dir }}"
config_format: "json"
register: result
- name: Print configuration
debug:
var: result.ansible_facts.junos.config
PLAY [Get device facts and configuration] *********************************************************************************************************************************
TASK [Retrieve device facts and configuration and save facts to file] *****************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: Type 'dict' cannot be serialized.
fatal: [pyezconnectiontestcases]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-local-39848jtfuf_9a/ansible-tmp-1724827689.1479154-39852-184082776198465/AnsiballZ_facts.py\", line 107, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-local-39848jtfuf_9a/ansible-tmp-1724827689.1479154-39852-184082776198465/AnsiballZ_facts.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-local-39848jtfuf_9a/ansible-tmp-1724827689.1479154-39852-184082776198465/AnsiballZ_facts.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.juniper.device.plugins.modules.facts', init_globals=dict(_module_fqn='ansible_collections.juniper.device.plugins.modules.facts', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_juniper.device.facts_payload_3t81csub/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py\", line 367, in <module>\n File \"/tmp/ansible_juniper.device.facts_payload_3t81csub/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py\", line 349, in main\n File \"/tmp/ansible_juniper.device.facts_payload_3t81csub/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py\", line 1302, in get_configuration\n File \"/tmp/ansible_juniper.device.facts_payload_3t81csub/ansible_juniper.device.facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py\", line 1784, in get_config\n File \"/tmp/ansible_juniper.device.facts_payload_3t81csub/ansible_juniper.device.facts_payload.zip/ansible/module_utils/connection.py\", line 199, in __rpc__\nansible.module_utils.connection.ConnectionError: Type 'dict' cannot be serialized.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
PLAY RECAP ****************************************************************************************************************************************************************
pyezconnectiontestcases : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
The text was updated successfully, but these errors were encountered:
chidanandpujar
changed the title
juniper.device.facts with config_format: "json" with persistent connection juniper.device.pyez fails with error ansible.module_utils.connection.ConnectionError: Type 'dict' cannot be serialized.\n"
juniper.device.facts with config_format: "json" with persistent connection juniper.device.pyez fails with ConnectionError: Type 'dict' cannot be serialized.\n"
Aug 28, 2024
Issue Type
Module Name
juniper.device.facts
juniper.device collection and Python libraries version
Summary
juniper.device.facts with config_format: "json" with persistent connection juniper.device.pyez fails with error ansible.module_utils.connection.ConnectionError: Type 'dict' cannot be serialized.\n"
Steps to reproduce
The text was updated successfully, but these errors were encountered: