Python Crashes when using this Plugin in OSX High Sierra
See original GitHub issueSummary: Attempting to use this plugin on High Sierra is causing a python crash. Reproduced on both Python 2.7.14 and 3.6.2 (installed with brew). Unable to reproduce with other lookup plugins.
Reproduction: A simple playbook with a debug step will do:
- hosts: localhost
tasks:
- debug:
msg: "{{ lookup('vault', 'secret/dev/test', 'hello') }}"
Symptoms: In the terminal which executes this playbook, the output looks like:
PLAY [localhost] ***************************************************************
TASK [Gathering Facts] *********************************************************
ok: [localhost]
TASK [debug] *******************************************************************
objc[34976]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[34976]: +[__NSPlaceholderDate 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.
Additional notes:
This appears to be due to some low-level objective-C changes introduced in High Sierra. This article (http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html) has more details. It also provides a workaround: Setting the environment variable OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
. Setting this before running ansible provides successful results.
I’ll be honest, I have no clue what the “correct” fix is here, or even if it can be made in this plugin (as opposed to ansible or python itself). Mostly I’m documenting this here in case others come across this issue - I hope someone finds this useful. I’m content with using the environment variable for the time being.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:15
- Comments:8 (1 by maintainers)
Top GitHub Comments
I would also mention that you need to export
no_proxy='*'
as found on this webpage. Otherwise you will get messages likeERROR! A worker was found in a dead state
. I’m running in macOS 10.13.3 , a python virtualenv with python version 2.7.10 and tip of master.@mikedlr unfortunately no longer have the means to retest - traded the mac for a PC since I created this issue. My apologies!