Configuring Monasca Grafana datasource fails

Bug #1878878 reported by Doug Szumski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Medium
Doug Szumski
Ussuri
Fix Released
Medium
Doug Szumski

Bug Description

The following failure registering the Monasca Grafana datasource was seen when reconfiguring the Monasca service using the master branch of KA:

`
TASK [monasca : Enable Monasca Grafana datasource for control plane organisation] ********************************************************************************************************************************************************************************************************************************************
task path: /home/lab/kolla-venv/share/kolla-ansible/ansible/roles/monasca/tasks/post_config.yml:100
<192.168.33.30> ESTABLISH SSH CONNECTION FOR USER: kolla
<192.168.33.30> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="kolla"' -o ConnectTimeout=10 -o ControlPath=/home/lab/.ansible/cp/c84f08009d 192.168.33.30 '/bin/sh -c '"'"'echo ~kolla && sleep 0'"'"''
<192.168.33.30> (0, b'/home/kolla\n', b'')
<192.168.33.30> ESTABLISH SSH CONNECTION FOR USER: kolla
<192.168.33.30> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="kolla"' -o ConnectTimeout=10 -o ControlPath=/home/lab/.ansible/cp/c84f08009d 192.168.33.30 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/kolla/.ansible/tmp `"&& mkdir /home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992 && echo ansible-tmp-1589532535.97833-740-75142933736992="` echo /home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992 `" ) && sleep 0'"'"''
<192.168.33.30> (0, b'ansible-tmp-1589532535.97833-740-75142933736992=/home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992\n', b'')
Using module file /home/lab/kolla-venv/share/kolla-ansible/ansible/library/kolla_toolbox.py
<192.168.33.30> PUT /home/lab/.ansible/tmp/ansible-local-1132894_8kq07/tmpzarpcnto TO /home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992/AnsiballZ_kolla_toolbox.py
<192.168.33.30> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="kolla"' -o ConnectTimeout=10 -o ControlPath=/home/lab/.ansible/cp/c84f08009d '[192.168.33.30]'
<192.168.33.30> (0, b'sftp> put /home/lab/.ansible/tmp/ansible-local-1132894_8kq07/tmpzarpcnto /home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992/AnsiballZ_kolla_toolbox.py\n', b'')
<192.168.33.30> ESTABLISH SSH CONNECTION FOR USER: kolla
<192.168.33.30> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="kolla"' -o ConnectTimeout=10 -o ControlPath=/home/lab/.ansible/cp/c84f08009d 192.168.33.30 '/bin/sh -c '"'"'chmod u+x /home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992/ /home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992/AnsiballZ_kolla_toolbox.py && sleep 0'"'"''
<192.168.33.30> (0, b'', b'')
<192.168.33.30> ESTABLISH SSH CONNECTION FOR USER: kolla
<192.168.33.30> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="kolla"' -o ConnectTimeout=10 -o ControlPath=/home/lab/.ansible/cp/c84f08009d -tt 192.168.33.30 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-vjuurpgrvbkzwszltvdraykaiietvgtp ; /opt/kayobe/venvs/kolla-ansible/bin/python /home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992/AnsiballZ_kolla_toolbox.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
<192.168.33.30> (0, b'\r\n{"action": "uri", "changed": false, "connection": "close", "content_length": "55", "content_type": "application/json; charset=UTF-8", "date": "Fri, 15 May 2020 08:48:57 GMT", "elapsed": 0, "invocation": {"module_args": {"attributes": null, "backup": null, "body": "{\\"name\\": \\"Monasca API\\", \\"type\\": \\"monasca-datasource\\", \\"access\\": \\"proxy\\", \\"url\\": \\"http://192.168.33.20:8070\\", \\"isDefault\\": true, \\"basicAuth\\": false, \\"jsonData\\": {\\"keystoneAuth\\": true}}", "body_format": "json", "client_cert": null, "client_key": null, "content": null, "creates": null, "delimiter": null, "dest": null, "directory_mode": null, "follow": false, "follow_redirects": "safe", "force": false, "force_basic_auth": true, "group": null, "headers": {"Content-Type": "application/json"}, "http_agent": "ansible-httpget", "method": "POST", "mode": null, "owner": null, "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "regexp": null, "remote_src": null, "removes": null, "return_content": false, "selevel": null, "serole": null, "setype": null, "seuser": null, "src": null, "status_code": ["200", " 409"], "timeout": 30, "unix_socket": null, "unsafe_writes": null, "url": "http://192.168.33.20:3000/api/datasources", "url_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "url_username": "grafana_local_admin", "use_proxy": true, "user": "grafana_local_admin", "validate_certs": true}}, "json": {"message": "Data source with same name already exists"}, "msg": "HTTP Error 409: Conflict", "redirected": false, "status": 409, "url": "http://192.168.33.20:3000/api/datasources"}\r\n', b'Shared connection to 192.168.33.30 closed.\r\n')
<192.168.33.30> ESTABLISH SSH CONNECTION FOR USER: kolla
<192.168.33.30> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="kolla"' -o ConnectTimeout=10 -o ControlPath=/home/lab/.ansible/cp/c84f08009d 192.168.33.30 '/bin/sh -c '"'"'rm -f -r /home/kolla/.ansible/tmp/ansible-tmp-1589532535.97833-740-75142933736992/ > /dev/null 2>&1 && sleep 0'"'"''
<192.168.33.30> (0, b'', b'')
fatal: [controller0]: FAILED! => {
    "msg": "The conditional check 'monasca_grafana_datasource_response.status not in [200, 409] or (monasca_grafana_datasource_response.status == 409 and (\"Data source with same name already exists\" not in monasca_grafana_datasource_response.json.message|default(\"\"))' failed. The error was: template error while templating string: unexpected '}', expected ')'. String: {% if monasca_grafana_datasource_response.status not in [200, 409] or (monasca_grafana_datasource_response.status == 409 and (\"Data source with same name already exists\" not in monasca_grafana_datasource_response.json.message|default(\"\")) %} True {% else %} False {% endif %}"
}
`

In this case a datasource already exists, and the task should not fail.

Doug Szumski (dszumski)
Changed in kolla-ansible:
assignee: nobody → Doug Szumski (dszumski)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

Fix proposed to branch: master
Review: https://review.opendev.org/728393

Changed in kolla-ansible:
status: New → In Progress
Mark Goddard (mgoddard)
Changed in kolla-ansible:
importance: Undecided → Medium
milestone: none → 10.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/728393
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=776253c43642219ddbd3e7ded3e39c1ddc1d86b7
Submitter: Zuul
Branch: master

commit 776253c43642219ddbd3e7ded3e39c1ddc1d86b7
Author: Doug Szumski <email address hidden>
Date: Fri May 15 08:56:01 2020 +0000

    Fix registration of Monasca Grafana datasource

    The refactor in change I500cc8800c412bc0e95edb15babad5c1189e6ee4
    broke the task `Enable Monasca Grafana datasource for control
    plane organisation`. This change fixes the brackets.

    Change-Id: I9167a312be107fbfddfd07740f67845c2eaafc3d
    Closes-Bug: 1878878

Changed in kolla-ansible:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.