Skip to content

network_cli connections failing with "could not recover task_vars" #766

@craigers521

Description

@craigers521

Running ansible version 2.9.11 on macOS with python 3.8, with latest mitogen version from master, targeting cisco isr routers and other network_cli based connection devices. All playbooks fail with this error:

<10.119.122.254> attempting to start connection
<10.119.122.254> using connection plugin network_cli
<10.119.130.254> attempting to start connection
<10.119.130.254> using connection plugin network_cli
<10.119.122.254> local domain socket does not exist, starting it
<10.119.122.254> control socket path is /Users/cse015/.ansible/pc/92ada5d152
<10.119.122.254> local domain socket listeners started successfully
<10.119.122.254> loaded cliconf plugin ios from path /Users/cse015/python-virtual-environments/ansible29/lib/python3.8/site-packages/ansible/plugins/cliconf/ios.py for network_os ios
<10.119.122.254>
<10.119.122.254> local domain socket path is /Users/cse015/.ansible/pc/92ada5d152
<10.119.130.254> local domain socket does not exist, starting it
<10.119.130.254> control socket path is /Users/cse015/.ansible/pc/77c5115e9c
<10.119.130.254> local domain socket listeners started successfully
<10.119.130.254> loaded cliconf plugin ios from path /Users/cse015/python-virtual-environments/ansible29/lib/python3.8/site-packages/ansible/plugins/cliconf/ios.py for network_os ios
<10.119.130.254>
<10.119.130.254> local domain socket path is /Users/cse015/.ansible/pc/77c5115e9c
fatal: [10.119.122.254]: UNREACHABLE! => {
    "changed": false,
    "msg": "could not recover task_vars. This means some connection settings may erroneously be reset to their defaults. Please report a bug if you encounter this message.",
    "unreachable": true
}
fatal: [10.119.130.254]: UNREACHABLE! => {
    "changed": false,
    "msg": "could not recover task_vars. This means some connection settings may erroneously be reset to their defaults. Please report a bug if you encounter this message.",
    "unreachable": true

I also tried running with ansible 2.10 and the latest collectionSupport branch from the s1113950 fork and i was met with a different error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 158, in run
    res = self._execute()
  File "/usr/local/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 613, in _execute
    self._connection = self._get_connection(cvars, templar)
  File "/usr/local/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 908, in _get_connection
    connection, plugin_load_context = self._shared_loader_obj.connection_loader.get_with_context(
  File "/Users/cse015/.ansible/plugins/mitogen-dev/ansible_mitogen/strategy.py", line 170, in wrap_connection_loader__get
    return ansible_mitogen.loaders.connection_loader__get(name, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ansible/plugins/loader.py", line 826, in get_with_context
    obj.__init__(instance, *args, **kwargs)
  File "/Users/cse015/.ansible/collections/ansible_collections/ansible/netcommon/plugins/connection/network_cli.py", line 324, in __init__
    super(Connection, self).__init__(
  File "/usr/local/lib/python3.8/site-packages/ansible/plugins/connection/__init__.py", line 290, in __init__
    self._update_connection_state()
  File "/usr/local/lib/python3.8/site-packages/ansible/plugins/connection/__init__.py", line 368, in _update_connection_state
    control_path = ssh._create_control_path(
  File "/Users/cse015/.ansible/plugins/mitogen-dev/ansible_mitogen/plugins/connection/mitogen_ssh.py", line 67, in _create_control_path
    return Connection.vanilla_class._create_control_path(*args, **kwargs)
AttributeError: 'get_with_context_result' object has no attribute '_create_control_path'
fatal: [10.119.130.254]: FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions