Skip to content

Ansible fork error on macOS running Python 3.9 #543

Description

  • Operating System Version: 10.15.7
  • Deploying via (VirtualBox/VMWare/AWS/Azure/ESXi): Azure
  • Vagrant Version (if applicable): Not applicable

Description of the issue:

While attempting to provision the Windows hosts via Ansible I got the following error:

TASK [Gathering Facts] **************************************************************************************************************************************************************************************************************** objc[21451]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. objc[21451]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. ERROR! A worker was found in a dead state

I came across this blog post which solved the issue for me:
https://rafpe.ninja/2018/02/24/ansible-error-nsplaceholderdate-initialize-may-have-been-in-progress-in-another-thread-when-fork-was-called/

Adding the following command before running the Ansible playbooks solved the issue

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

You may want to add this to your build documentation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions