Skip to content

copy module - A worker was found in a dead state #86946

@drboone

Description

@drboone

Summary

Frequent task failures, seemingly mostly with copy module.
[ERROR]: A worker was found in a dead state

There are a lot of reports of this error message, seemingly revolving around:

  • Master machine is a Mac. Not the case here.
  • Very large files to copy. Not the case here. In the reported example, the file is 864 bytes.
  • Small amounts of master machine RAM available. Seemingly not the case here: Memory: 12G phys mem, 6358M free mem, 16G total swap, 16G free swap. This doesn't change significantly during the ansible run.
  • Small amounts of target machine RAM available. Seemingly not the case here: total: 130257356k bytes allocated + 2619760k reserved = 132877116k used, 270847148k available.

Issue Type

Bug Report

Component Name

copy

Ansible Version

$ ansible --version
ansible [core 2.20.4]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/local/lib/python3.12/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/local/bin/ansible
  python version = 3.12.13 (main, Apr 30 2026, 17:35:44) [GCC 13.4.0] (/opt/local/bin/python3.12)
  jinja version = 3.1.3
  pyyaml version = 6.0.3 (with libyaml v0.2.5)

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
CONFIG_FILE() = /etc/ansible/ansible.cfg
PAGER(env: PAGER) = less
RETRY_FILES_SAVE_PATH(/etc/ansible/ansible.cfg) = /tmp

GALAXY_SERVERS:


CONNECTION:
==========

paramiko_ssh (DEPRECATED):
_________________________
look_for_keys(/etc/ansible/ansible.cfg) = True
private_key_file(/etc/ansible/ansible.cfg) = /root/.ssh/capablanca_idkey

paramiko_ssh:
____________
look_for_keys(/etc/ansible/ansible.cfg) = True
private_key_file(/etc/ansible/ansible.cfg) = /root/.ssh/capablanca_idkey

ssh:
___
pipelining(/etc/ansible/ansible.cfg) = True

OS / Environment

OS: SunOS chess.h-net.org 5.11 joyent_20250206T001102Z i86pc i386 i86pc illumos
Ansible runs in a guest zone.

Python 3.12.13

Steps to Reproduce

    - name:         Copy out local image installer
      copy:         src={{ collpath }}/miscbin/install_local_zoneimages
                      dest=/opt/local/sbin/
                      owner=root group=root mode='2755'

Expected Results

Successful copy.

Actual Results

TASK [Copy out local image installer] ******************************************
Exception ignored in: <function _after_fork at 0xcd46e0>
Traceback (most recent call last):
  File "/opt/local/lib/python3.12/threading.py", line 1649, in _after_fork
[ERROR]: A worker was found in a dead state
    def _after_fork():
    
  File "/opt/local/lib/python3.12/site-packages/ansible/executor/task_queue_manager.py", line 211, in _signal_handler
    if worker is None or not worker.is_alive():
                             ^^^^^^^^^^^^^^^^^
  File "/opt/local/lib/python3.12/multiprocessing/process.py", line 160, in is_alive
    assert self._parent_pid == os.getpid(), 'can only test a child process'
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: can only test a child process

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects_2.20bugThis issue/PR relates to a bug.moduleThis issue/PR relates to a module.

    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