# \`meta: reset\_connection\` causes "A worker was found in a dead state"

**URL:** <https://forum.ansible.com/t/meta-reset-connection-causes-a-worker-was-found-in-a-dead-state/45558>\
**Category:** Get Help\
**Created:** [March 18, 2026, 7:59pm UTC](https://forum.ansible.com/t/meta-reset-connection-causes-a-worker-was-found-in-a-dead-state/45558 "2026-03-18T19:59:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gowthamakanthan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gowthamakanthan/32/7459_2.png) [@Gowthamakanthan](https://forum.ansible.com/u/Gowthamakanthan)\
**Post date:** [March 18, 2026, 7:59pm UTC](https://forum.ansible.com/t/meta-reset-connection-causes-a-worker-was-found-in-a-dead-state/45558/1 "2026-03-18T19:59:15Z")

</div>

When using `meta: reset_connection` (directly or via a handler triggered by `meta: flush_handlers`), the playbook fails with:

```auto
[ERROR]: A worker was found in a dead state

```

### Use Case

Common pattern for allowing a user to access Docker after being added to the `docker` group on first run (see [Jeff Geerling’s blog](https://www.jeffgeerling.com/blog/2021/allowing-ansible-playbooks-work-new-user-groups-on-first-run)):

```yaml
- name: Add user to docker group
  ansible.builtin.user:
    name: "{{ ansible_user }}"
    groups: docker
    append: true
  notify: Reset connection

- name: Flush handlers
  ansible.builtin.meta: flush_handlers

- name: Deploy container # Fails: worker dead
  community.docker.docker_compose_v2:
    project_src: /opt/coredns
    state: present

handlers:
  - name: Reset connection
    ansible.builtin.meta: reset_connection

```

### Environment

- **Controller:** macOS (ansible-playbook run locally)
- **Target:** Linux hosts (SSH)
- **Ansible version:**

```auto
ansible [core 2.19.2]
  config file = None
  configured module search path = ['/Users/gowgopal/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/12.0.0/libexec/lib/python3.13/site-packages/ansible
  ansible collection location = /Users/gowgopal/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.13.7 (main, Aug 14 2025, 11:12:11) [Clang 17.0.0 (clang-1700.3.19.1)] (/opt/homebrew/Cellar/ansible/12.0.0/libexec/bin/python)
  jinja version = 3.1.6
  pyyaml version = 6.0.2 (with libyaml v0.2.5)

```

## Expected Behavior

Connection resets cleanly; subsequent tasks run with a fresh SSH session that has the new group membership.

### Actual Behavior

Worker process dies; playbook fails with “A worker was found in a dead state” on the next task.

### Workaround

Avoid `reset_connection` and use `sg` to run Docker commands with the group active:

```yaml
- name: Start containers
  ansible.builtin.command:
    cmd: sg docker -c "docker compose up -d --pull always"
  args:
    chdir: /opt/coredns

```

### Related Issues / PRs

- [ansible#50306](https://github.com/ansible/ansible/issues/50306) – Meta module: reset\_connection is always failing (handler returns “connection closed” as failure)
- [ansible#73708](https://github.com/ansible/ansible/pull/73708) – Fix: reset\_connection to use same parameters for socket check (SSH plugin migration)
- [ansible#32554](https://github.com/ansible/ansible/issues/32554) – “A worker was found in a dead state”
- [ansible#79757](https://github.com/ansible/ansible/issues/79757) – Worker dead state affecting operator
- [ansible#68341](https://github.com/ansible/ansible/issues/68341) – SSH connection reset and controlpath
