ansible-prometheus icon indicating copy to clipboard operation
ansible-prometheus copied to clipboard

child process. Crashing instead. - Checksums

Open khmarbaise opened this issue 3 years ago • 3 comments

What happened? Executing the following command:

$ ansible-playbook -vvv -u vagrant monitoring.yml -t prometheus

Part of my monitoring.yml:

- name: Prometheus
  hosts: prometheus
  tags:
      - prometheus
  roles:
    - role: cloudalchemy.prometheus
      prometheus_version: 2.32.1
      prometheus_alertmanager_config:
        - scheme: http
          path_prefix: alertmanager/
          basic_auth:
          username: user
          password: pass
          static_configs:
            - targets: ["127.0.0.1:9093"]
          proxy_url: "127.0.0.2"
      prometheus_alert_rules:
        - prometheus/rules/*.rules
      prometheus_web_external_url: '0.0.0.0:9090'

Did you expect to see some different?

How to reproduce it (as minimally and precisely as possible):

Environment

monitoring (main *)$ ansible-playbook -vvv -u vagrant monitoring.yml -t prometheus
ansible-playbook [core 2.11.6] 
  config file = /Users/xxx/monitoring/ansible.cfg
  configured module search path = ['/Users/xxxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/4.7.0_1/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/xxxx/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.10.0 (default, Oct 13 2021, 06:43:20) [Clang 11.0.0 (clang-1100.0.33.17)]
  jinja version = 3.0.2
  libyaml = True
  • Role version:
  - name: cloudalchemy.prometheus
    version: 4.0.0
  • Ansible version information:
 monitoring (main *)$ ansible --version
ansible [core 2.11.6] 
  config file = /Users/xxx/monitoring/ansible.cfg
  configured module search path = ['/Users/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/4.7.0_1/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/xxx/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.0 (default, Oct 13 2021, 06:43:20) [Clang 11.0.0 (clang-1100.0.33.17)]
  jinja version = 3.0.2
  libyaml = True
  • Variables:
insert role variables relevant to the issue
  • Ansible playbook execution Logs:
TASK [cloudalchemy.prometheus : Set prometheus version to {{ _latest_release.json.tag_name[1:] }}] ************************************************************
task path: /Users/xxx/monitoring/roles/cloudalchemy.prometheus/tasks/preflight.yml:91
skipping: [prom01] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [cloudalchemy.prometheus : Get checksum list] ************************************************************************************************************
task path: /Users/xxxx/monitoring/roles/cloudalchemy.prometheus/tasks/preflight.yml:100
objc[26347]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[26347]: +[__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.

Anything else we need to know?:

I've taken a look into the source code. The line 100 is exactly the line - name: "Get checksum list"

- block:
    - name: "Get checksum list"
      set_fact:
        __prometheus_checksums: "{{ lookup('url', 'https://github.com/prometheus/prometheus/releases/download/v' + prometheus_version + '/sha256sums.txt', wantlist=True) | list }}"
      run_once: true

    - name: "Get checksum for {{ go_arch }} architecture"
      set_fact:
        __prometheus_checksum: "{{ item.split(' ')[0] }}"
      with_items: "{{ __prometheus_checksums }}"
      when:
        - "('linux-' + go_arch + '.tar.gz') in item"

khmarbaise avatar Dec 23 '21 12:12 khmarbaise

Workaround:

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

vikmeup avatar Jan 04 '22 06:01 vikmeup

Unfortunately @vikmeup 's workaround listed above doesn't work for me on Mac M1 with ansible core 2.12.1, python 3.10 .

inflatador avatar Mar 22 '22 14:03 inflatador

Same for me with python 3.10.3 and ansible 2.12.5.

The workaround doesn't seem to work anymore.

It seems to be a known issue with ansible on macos: https://github.com/ansible/ansible/issues/76322

kristjankullerkann avatar May 03 '22 06:05 kristjankullerkann

This role has been deprecated in favor of a the prometheus-community/ansible collection.

SuperQ avatar Mar 06 '23 15:03 SuperQ