apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.56k stars 1.17k forks source link

Ansible cli deploy error #5204

Closed hunhoffe closed 2 years ago

hunhoffe commented 2 years ago

Environment details:

Steps to reproduce the issue:

  1. Install docker
  2. Follow ansible setup directions (summarized explicitly in the attached markdown file: ansible_setup.md

Provide the actual results and outputs:

Command that leads to error:

ansible-playbook -i environments/$ENVIRONMENT openwhisk.yml -e db_activation_backend=ElasticSearch

Error:

TASK [cli : Download release archive to build directory ...] ***********************************************************************************************************************************************
Tuesday 22 March 2022  14:56:04 -0600 (0:00:00.397)       0:02:33.675 ********* 
fatal: [172.17.0.1]: FAILED! => {"changed": false, "msg": "argument 'headers' is of type <class 'str'> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value"}

argument 'headers' is of type <class 'str'> and we were unable to convert
to dict: dictionary requested, could not parse JSON or key=value. 

Target Summary:

PLAY RECAP *************************************************************************************************************************************************************************************************
172.17.0.1                 : ok=11   changed=9    unreachable=0    failed=1    skipped=7    rescued=0    ignored=0   
controller0                : ok=30   changed=7    unreachable=0    failed=0    skipped=14   rescued=0    ignored=0   
etcd0                      : ok=5    changed=1    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
invoker0                   : ok=33   changed=10   unreachable=0    failed=0    skipped=25   rescued=0    ignored=0   
kafka0                     : ok=10   changed=4    unreachable=0    failed=0    skipped=7    rescued=0    ignored=0   
scheduler0                 : ok=23   changed=6    unreachable=0    failed=0    skipped=13   rescued=0    ignored=0 

The Fix

Change openwhisk/ansible/roles/cli/tasks/deploy.yml, line 38

-    headers: "{{ openwhisk_cli.remote.headers | default('') }}"
+    headers: "{{ openwhisk_cli.remote.headers | default('{}') }}"

Additional information you deem important:

rabbah commented 2 years ago

This looks like a correct path - it's saying the default value when remote.headers are not defined is {} not '' which seems necessary for the JSON parsing going on per the error message.

hunhoffe commented 2 years ago

Addressed this in pull request, closing this issue.