mitogen-hq / mitogen

Distributed self-replicating programs in Python
https://mitogen.networkgenomics.com/
BSD 3-Clause "New" or "Revised" License
2.34k stars 199 forks source link

Connection to cisco with ansible_become_method: enable fails #643

Open opoplawski opened 5 years ago

opoplawski commented 5 years ago

[WARNING]: [task 2376] 14:43:36.073559 W ansible_mitogen.connection: 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.

[WARNING]: [task 2376] 14:43:36.074017 W ansible_mitogen.connection: 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. [WARNING]: Unhandled error in Python interpreter discovery for host switch- cisco-4948-1.cora.nwra.com: u'enable'

Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_facts.py Pipelining is enabled.

[WARNING]: [task 2376] 14:43:36.080669 W ansible_mitogen.connection: 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.

[WARNING]: [task 2376] 14:43:36.080922 W ansible_mitogen.connection: 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. The full traceback is: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 145, in run res = self._execute() File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 664, in _execute result = self._handler.run(task_vars=variables) File "/usr/lib/python2.7/site-packages/ansible/plugins/action/ios.py", line 95, in run result = super(ActionModule, self).run(task_vars=task_vars) File "/usr/lib/python2.7/site-packages/ansible/plugins/action/network.py", line 48, in run result = super(ActionModule, self).run(task_vars=task_vars) File "/usr/lib/python2.7/site-packages/ansible/plugins/action/normal.py", line 46, in run result = merge_hash(result, self._execute_module(task_vars=task_vars, wrap_async=wrap_async)) File "/usr/lib/python2.7/site-packages/ansible/plugins/action/init.py", line 917, in _execute_module
res = self._low_level_execute_command(cmd, sudoable=sudoable, in_data=in_data) File "/usr/lib/python2.7/site-packages/ansible/plugins/action/init.py", line 1062, in _low_level_execute_command
rc, stdout, stderr = self._connection.exec_command(cmd, in_data=in_data, sudoable=sudoable) File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 289, in exec_command
return super(Connection, self).exec_command(cmd, in_data, sudoable) File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/init.py", line 304, in exec_command
return self._local.exec_command(cmd, in_data, sudoable) File "/export/home/orion-admin/ansible-boulder/mitogen-0.2.8/ansible_mitogen/connection.py", line 929, in exec_command
rc, stdout, stderr = self.get_chain().call( File "/export/home/orion-admin/ansible-boulder/mitogen-0.2.8/ansible_mitogen/connection.py", line 875, in get_chain
self._connect() File "/export/home/orion-admin/ansible-boulder/mitogen-0.2.8/ansible_mitogen/connection.py", line 779, in _connect inventory_name, stack = self._build_stack() File "/export/home/orion-admin/ansible-boulder/mitogen-0.2.8/ansible_mitogen/connection.py", line 717, in _build_stack stack = self._stack_from_spec(spec) File "/export/home/orion-admin/ansible-boulder/mitogen-0.2.8/ansible_mitogen/connection.py", line 700, in _stack_from_spec stack += (CONNECTION_METHODspec.become_method(),) KeyError: u'enable'


master seems to fail differently:

TASK [Gather facts] *** task path: /export/home/orion-admin/ansible-boulder/playbooks/cisco_portfast.yml:5 Tuesday 27 August 2019 14:48:56 -0600 (0:00:00.522) 0:00:00.522 **** [task 3558] 14:48:56.758255 D ansible_mitogen.affinity: CPU mask for WorkerProcess: 0x000004

Attempting python interpreter discovery [WARNING]: Unhandled error in Python interpreter discovery for host switch- cisco-4948-1.cora.nwra.com: 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. Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_facts.py Pipelining is enabled. fatal: [switch-cisco-4948-1.cora.nwra.com]: 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 } ```
nomoresecrets commented 4 years ago

Got the same issue after upgrading my Ansible/Mitogen setup

Ansible: 2.9.4 Mitogen: 0.2.9 Python: 2.7.17

craigers521 commented 3 years ago

bump. having same issue on ansible 2.9.11 and mitogen current master.


fatal: [XXX.XXX.XXX.XXX]: 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
s1113950 commented 3 years ago

I don't have a cisco setup available; is there a docker image somewhere that would be a good test of the enable become method? I've never used that one before 🤔