Ansible Pilot

Ansible troubleshooting - macOS fork error

How to troubleshoot and fix the macOS fork error that might happen since macOS 10.13 High Sierra.

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.

demo

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

error

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

export "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES"

fix all future sessions

echo "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> .bash_profile

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

$ env
[...]
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

code with ❤️ in GitHub

Recap

Now you know better how to troubleshoot the macOS fork error and how to fix it. Subscribe to the YouTube channel, Medium, Website and Twitter to not miss the next episode of the Ansible Pilot.

Academy

Learn the Ansible automation technology with some real-life examples in my

Want to keep this project going? Please donate

Trustpilot
Follow me

Subscribe not to miss any new releases

August 23, 2021

FREE Top 10 Best Practices

Top 10 Best Practices of Ansible Automation: save time, reduce errors and stress