在使用Mac上的Ansible连接Windows服务器时遇到的错误 [错误!发现工作进程处于非正常状态]
环境
- macOS Catalina バージョン 10.15.2
ansible: 2.9.2
config file = None
configured module search path = ['/Users/aoshima/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /Users/aoshima/.local/share/virtualenvs/tests-jeV_LJ4f/lib/python3.7/site-packages/ansible
executable location = /Users/aoshima/.local/share/virtualenvs/tests-jeV_LJ4f/bin/ansible
python version = 3.7.6 (default, Dec 30 2019, 19:38:26) [Clang 11.0.0 (clang-1100.0.33.16)]
错误内容 (Mandarin Chinese)
当我尝试使用 Ansible 的 win_ping 来确认连接到 Windows 服务器时,出现了错误。
$ ansible windows -i ./inventory -m win_ping
objc[47572]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[47572]: +[__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.
objc[47571]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[47571]: +[__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.
ERROR! A worker was found in a dead state
避免策略
据我所了解,这篇文章提到了在GitHub上的某个问题链接,其中解释了一个解决方法。这个问题似乎与macOS上的Python有关,但由于一时无法理解,所以就把它搁置了…
$ export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
我现在可以连接了。