Loading...

Watch: Troubleshoot macOS Fork Errors in Ansible Playbooks

Discover how to troubleshoot and fix macOS fork errors in Ansible playbooks with Luca Berton. Watch the Playbook and solve the issue quickly!

Today we're going to talk about Ansible troubleshooting and specifically about macOS fork errors.

I'm Luca Berton and welcome to today's episode of the Ansible Pilot.

Playbook

The best way of talking about Ansible troubleshooting is to jump in a live Playbook to show you practically the macOS fork error and how to solve it!

error

  • error

``bash

objc[22868]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.

objc[22868]: +[__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.

`

fix current session

  • fix - current session only

`bash

export "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES"

`

fix all future sessions

  • fix - for all future sessions

`bash

echo "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> .bash_profile

`

You could verify the environment of the terminal with the following command:

`bash

$ env

[...]

OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

``

[code with ❤️ in GitHub](https://github.com/lucab85/ansible-pilot/tree/master/troubleshooting)

Conclusion

Now you know better how to troubleshoot the macOS fork error and how to fix it.

Read the full tutorial: Troubleshoot macOS Fork Errors in Ansible Playbooks