# Unable to create the new dashboard : 404 messageDashboard not found

**URL:** <https://forum.ansible.com/t/unable-to-create-the-new-dashboard-404-messagedashboard-not-found/31930>\
**Category:** Ansible Project\
**Created:** [January 8, 2020, 1:35pm UTC](https://forum.ansible.com/t/unable-to-create-the-new-dashboard-404-messagedashboard-not-found/31930 "2020-01-08T13:35:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anilkumar\_panditi](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@anilkumar\_panditi](https://forum.ansible.com/u/anilkumar_panditi)\
**Post date:** [January 8, 2020, 1:35pm UTC](https://forum.ansible.com/t/unable-to-create-the-new-dashboard-404-messagedashboard-not-found/31930/1 "2020-01-08T13:35:09Z")

</div>

I am trying to import a Grafana dashboard(JSON) to Grafana. Following is the ansible playbook

```auto
---
- 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"

```

```auto
And i am getting error below.

```

```auto
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`

```auto

```

---

<div class="post-metadata">

**Author:** ![Michael\_M1](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Post date:** [January 9, 2020, 1:32am UTC](https://forum.ansible.com/t/unable-to-create-the-new-dashboard-404-messagedashboard-not-found/31930/2 "2020-01-09T01:32:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anilkumar\_panditi](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@anilkumar\_panditi](https://forum.ansible.com/u/anilkumar_panditi)\
**Post date:** [January 9, 2020, 4:20am UTC](https://forum.ansible.com/t/unable-to-create-the-new-dashboard-404-messagedashboard-not-found/31930/3 "2020-01-09T04:20:20Z")

</div>

Yeah correct ,so i tried to run the playbook with uid as null ,but getting same error.

---

<div class="post-metadata">

**Author:** ![Michael\_M1](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Post date:** [January 9, 2020, 11:18pm UTC](https://forum.ansible.com/t/unable-to-create-the-new-dashboard-404-messagedashboard-not-found/31930/4 "2020-01-09T23:18:14Z")

</div>

If you purposely redacted the IP from the output (http://:3000) then I am out of idea. Otherwise, that would be your issue

---

<div class="post-metadata">

**Author:** ![Ferry\_Bodijn](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@Ferry\_Bodijn](https://forum.ansible.com/u/Ferry_Bodijn)\
**Post date:** [February 21, 2020, 8:24am UTC](https://forum.ansible.com/t/unable-to-create-the-new-dashboard-404-messagedashboard-not-found/31930/5 "2020-02-21T08:24:28Z")

</div>

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.
