ERROR! A worker was found in a dead state

954 views
Skip to first unread message

Guy Matz

unread,
Aug 31, 2020, 1:41:51 PM8/31/20
to ansible...@googlegroups.com
Hi!  I have a task which ends simply with:

< TASK [pomerium : Put config file in place] >
 --------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

ERROR! A worker was found in a dead state

Running with -vvvv has "mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0", but doesn't seem to reveal anything relevant otherwise.

The task definitions is:
  - name: Put config file in place
    template:
        src: "{{ ec2_tags['Tags']|selectattr('Key', 'equalto', 'Role')|map(attribute='Value')|list|first }}.yaml.j2"
        dest: /opt/pomerium/conf/pomerium.yaml
        owner: root
        group: root
        mode: 0644
        backup: yes
    notify:
        - restart pomerium


I have put a debug in place:
  - debug: msg="{{ ec2_tags['Tags']|selectattr('Key', 'equalto', 'Role')|map(attribute='Value')|list|first }}.yaml.j2"

Which gives:
ok: [ec2-52-23-213-95.compute-1.amazonaws.com] => {
    "msg": "pomauthn.yaml.j2"
}

So, it does not seem to be an issue with the jinja.

Any thoughts on how to debug this would be greatly appreciated!!


P.S. -
ansible-playbook --version
ansible-playbook 2.9.12
  config file = /Users/matz/Code/schransible/ansible.cfg
  configured module search path = ['/Users/matz/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/matz/.virtualenvs/schransible/lib/python3.8/site-packages/ansible
  executable location = /Users/matz/.virtualenvs/schransible/bin/ansible-playbook
  python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]

jbor...@gmail.com

unread,
Aug 31, 2020, 4:35:31 PM8/31/20
to Ansible Project

Looks like you are running on macOS based on the paths in your ansible-playbook --version output. There is a known problem with running Ansible on macOS [1] where certain system calls on the forked Ansible process cause the process to get killed by the kernel. This is a pretty fundamental issue in how Ansible creates the forked processes and how macOS treats those processes. There's not much we can do right for a fix but setting the env var 'OBJC_DISABLE_INITIALIZE_FORK_SAFETY=yes' may "fix" the problem for now. There are cases where even this env var won't work but it's worth a try.

spiro.m...@mcgill.ca

unread,
Sep 1, 2020, 12:53:07 PM9/1/20
to Ansible Project
I got the error a few weeks ago.  Turned out the server was running out of memory.  
Reply all
Reply to author
Forward
0 new messages