redhat-cop / openshift-applier

Used to apply OpenShift objects to an OpenShift Cluster
Apache License 2.0
102 stars 61 forks source link

[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. #132

Closed Gl4di4torRr closed 4 years ago

Gl4di4torRr commented 4 years ago

I am trying to process and apply a template that is located on my openshift cluster. I am using applier 2.0.9 and my task looks like

- object: jenkins-mycompany
  content:
  - name: "deploy mycompany jenkins image"
    template: "openshift//mycompany-jenkins"
    params: "{{ inventory_dir }}/../.openshift/params/mycompany-jenkins"
    tags:
      - sbx
      - build

The error I am receiving:

objc[6472]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[6472]: +[__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.```

This only happens when a template is already on the cluster and not local to my project.

jacobsee commented 4 years ago

Hi Chris. This is not a problem specific to openshift-applier - it is a problem with how Ansible forks processes on macOS in general. It is documented here: ansible/ansible#32499

I wish there was a better answer, but I think the best workaround we have right now is to set the environment variable export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES before invoking Ansible. This has fixed it in my observation before.

Gl4di4torRr commented 4 years ago

@jacobsee that worked! Thanks so much. I was going crazy trying different types of combinations with create, apply, etc.

jacobsee commented 4 years ago

@Gl4di4torRr No problem! Glad you're able to move forward now. I'm going to close this issue here, as the problem lies below the openshift-applier project in the stack.