ansible-collections / junipernetworks.junos

Ansible Network Collection for Juniper JunOS
GNU General Public License v3.0
82 stars 63 forks source link

xmlSAX2Characters: huge text node for junipernetworks.junos.junos_config #322

Open viswanathsai opened 2 years ago

viswanathsai commented 2 years ago
SUMMARY

Throwing huge text error when running playbook to commit configuration to Juniper device using 'junipernetworks.junos.junos_config' module.

ISSUE TYPE

{ "msg": "b'xmlSAX2Characters: huge text node, line 110126, column 1 (, line 110126)'", "exception": " File \"/tmp/ansible_junipernetworks.junos.junos_config_payload_ghufnlmn/ansible_junipernetworks.junos.junos_config_payload.zip/ansible_collections/junipernetworks/junos/plugins/module_utils/network/junos/junos.py\", line 224, in get_configuration\n reply = conn.get_configuration(format=format, filter=filter)\n File \"/tmp/ansible_junipernetworks.junos.junos_config_payload_ghufnlmn/ansible_junipernetworks.junos.junos_config_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/netconf.py\", line 81, in rpc\n to_bytes(rpc_error, errors=\"surrogate_then_replace\")\n File \"/tmp/ansible_junipernetworks.junos.junos_config_payload_ghufnlmn/ansible_junipernetworks.junos.junos_config_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/netconf.py\", line 126, in parse_rpc_error\n raise ConnectionError(rpc_error)\n", "invocation": { "module_args": { "lines": [ "set security address-book global address ......", ], "confirm_commit": true, "update": "merge", "confirm": 0, "comment": "configured by junos_config", "check_commit": false, "backup": false, "zeroize": false, "src": null, "src_format": null, "replace": null, "backup_options": null, "rollback": null, "provider": null } }, "_ansible_no_log": false, "changed": false }


##### COMPONENT NAME
Throws error when i use - junipernetworks.junos.junos_config module.

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.10.2
  config file = /usr/share/nginx/networkclearance/application/ansible.cfg
  configured module search path = ['/home/b87969/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/share/nginx/networkclearance/application/lib/python3.6/site-packages/ansible
  executable location = /usr/share/nginx/networkclearance/application/bin/ansible
  python version = 3.6.8 (default, Aug 13 2020, 07:46:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
COLLECTION VERSION
$ ansible-galaxy collection list junipernetworks.junos

Collection            Version
--------------------- -------
junipernetworks.junos 2.10.0
CONFIGURATION
ANSIBLE_PIPELINING(/usr/share/nginx/networkclearance/data_center_automation_frr/ansible.cfg) = True
COLLECTIONS_PATHS(/usr/share/nginx/networkclearance/data_center_automation_frr/ansible.cfg) = ['/usr/share/nginx/networkclearance/data_center_automation_frr']
DEFAULT_FORKS(/usr/share/nginx/networkclearance/data_center_automation_frr/ansible.cfg) = 30
DEFAULT_TIMEOUT(/usr/share/nginx/networkclearance/data_center_automation_frr/ansible.cfg) = 30
DEFAULT_VAULT_PASSWORD_FILE(/usr/share/nginx/networkclearance/data_center_automation_frr/ansible.cfg) = /usr/share/nginx/networkclearance/data_center_automation_frr/vars/.vault_file
HOST_KEY_CHECKING(/usr/share/nginx/networkclearance/data_center_automation_frr/ansible.cfg) = False
PERSISTENT_COMMAND_TIMEOUT(/usr/share/nginx/networkclearance/data_center_automation_frr/ansible.cfg) = 600
PERSISTENT_CONNECT_TIMEOUT(/usr/share/nginx/networkclearance/data_center_automation_frr/ansible.cfg) = 600
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
jlmcgraw commented 2 years ago

Just to aid in troubleshooting, I was facing a similar issue with the juniper.device.config collection and tested a fix using huge_tree that resolved the issue

Add:

'huge_tree' : dict(type='bool', required=False, default=False),

to juniper_junos_common.py

and then "huge_tree: True" to the connection options in the playbook