Skip to content

Fetch fails with "AttributeError: 'ShellModule' object has no attribute 'tmpdir'" #716

@ari75

Description

@ari75

Hello,

I get an error when running a simple fetch command using mitogen.

My environment is:

Cent OS 7
Ansible 2.4.2.0
Mitogen 0.2.9
Python (host and target) 2.7.5
Strategy mitogen_linear

The following snippet can be used to reproduce the issue:

- name: T00.00 Prepare file
  lineinfile:
    path: "/tmp/fileC"
    line: "test"
    create: yes

- name: T00.01 Fetch file
  fetch:
    src: "/tmp/fileC"
    dest: "/tmp/fileC"

My ansible configuration is:

[ssh_connection] 
# ssh_args = -o ControlMaster=no
ssh_args=-C -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s
# speedup running of playbook
pipelining = True

[defaults]
callback_whitelist = profile_tasks, profile_roles
# Keep it to allow switching strategy if needed
strategy_plugins = strategy_plugins/mitogen-0.2.9/ansible_mitogen/plugins/strategy
strategy = mitogen_linear
forks = 30

The error is:

ASK [test : T00.01 Fetch file] ********************************************************************************************************************************************************************************************************
Thursday 14 May 2020  16:52:35 +0000 (0:00:00.097)       0:00:01.494 ********** 
Thursday 14 May 2020  16:52:35 +0000 (0:00:00.097)       0:00:01.492 ********** 
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'ShellModule' object has no attribute 'tmpdir'
fatal: [d-instance-1.local]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'ShellModule' object has no attribute 'tmpdir'
fatal: [d-instance-2.local]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}

Full logs with -vvv can be found here:
https://we.tl/t-rjfghK7Gpx

It seems to fail when attempting cleaning up after the copy (mitogen_fetch.py", line 160):

The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 130, in run
    res = self._execute()
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 528, in _execute
    result = self._handler.run(task_vars=variables)
  File "/vagrant/src/main/configuration/strategy_plugins/mitogen-0.2.9/ansible_mitogen/mixins.py", line 121, in run
    return super(ActionModuleMixin, self).run(tmp, task_vars)
  File "/vagrant/src/main/configuration/strategy_plugins/mitogen-0.2.9/ansible_mitogen/plugins/action/mitogen_fetch.py", line 160, in run
    self._remove_tmp_path(self._connection._shell.tmpdir)
AttributeError: 'ShellModule' object has no attribute 'tmpdir'

fatal: [d-instance-2.local]: FAILED! => {
    "msg": "Unexpected failure during module execution.", 
    "stdout": ""
}

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions