Unable to create the new dashboard : 404 messageDashboard not found

604 views
Skip to first unread message

anilkumar panditi

unread,
Jan 8, 2020, 8:35:09 AM1/8/20
to Ansible Project
I am trying to import a Grafana dashboard(JSON) to Grafana. Following is the ansible playbook
---
- name: task to parameterise grafana template
  hosts: localhost
  become: true
  user: root
  tasks:
    - name: Import Grafana dashboard
      grafana_dashboard:
        grafana_url: http://<host-ip>:3000
        state: present
        message: Updated by ansible
        uid: edO3sTlipu
        overwrite: yes
        path: "/home/centos/Kubernetes_cluster_monitoring.json"
And i am getting error below.
fatal: [localhost]: FAILED! => {"changed": false, "msg": "error : Unable to create the new dashboard None : 404 - {'status': 404, 'body': '{\"message\":\"Dashboard not found\",\"status\":\"not-found\"}', 'content-length': '54', 'url': 'http://<IP>:3000/api/dashboards/db', 'expires': '-1', 'msg': 'HTTP Error 404: Not Found', 'connection': 'close', 'pragma': 'no-cache', 'cache-control': 'no-cache', 'date': 'Wed, 08 Jan 2020 12:19:31 GMT', 'x-frame-options': 'deny', 'content-type': 'application/json'}."}
can you help please

Michael Mullay

unread,
Jan 8, 2020, 8:32:20 PM1/8/20
to ansible...@googlegroups.com
I have found that leaving out the uid and letting it default to null has worked. The documentation doesn't say explicitely but suggests it not be used for 'state: present'

- uid
        uid of the dashboard to export when `state' is `export' or `absent'.
        [Default: (null)]
        version_added: 2.7
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/044657b5-b1a2-4eec-a9b9-d623cd26cffd%40googlegroups.com.

anilkumar panditi

unread,
Jan 8, 2020, 11:20:21 PM1/8/20
to Ansible Project
Yeah correct ,so i tried to run the playbook with uid as null ,but getting same error.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.

Michael Mullay

unread,
Jan 9, 2020, 6:18:28 PM1/9/20
to ansible...@googlegroups.com
If you purposely redacted the IP from the output (http://<IP>:3000) then I am out of idea. Otherwise, that would be your issue

On Wed, 2020-01-08 at 20:20 -0800, anilkumar panditi wrote:
http://<IP>:3000

Ferry Bodijn

unread,
Feb 21, 2020, 3:24:28 AM2/21/20
to Ansible Project
When your JSON file contain a id field, Grafana API will search for a dashboard with this id, and if it does not exists it return a 404. Hence delete this from your JSON file and run your playbook.

Op woensdag 8 januari 2020 14:35:09 UTC+1 schreef anilkumar panditi:
Reply all
Reply to author
Forward
0 new messages