Msg="can't read datasource provisioning files from directory"

I am using docker-compose file to run the k6 script, use the influxdb data source and generate the dashboards in grafana. I created a couple of dashboards too. Today my docker-compose stopped working so I restarted it. But now I do not see my dashboards and I get the following error in the command prompt.

grafana_1 | t=2021-10-20T06:49:02+0000 lvl=eror msg=“can’t read datasource provisioning files from directory” logger=provisioning.datasources path=/etc/grafana/provisioning/datasources error=“open /etc/grafana/provisioning/datasources: no such file or directory”
grafana_1 | t=2021-10-20T06:49:02+0000 lvl=eror msg=“Can’t read alert notification provisioning files from directory” logger=provisioning.notifiers path=/etc/grafana/provisioning/notifiers error=“open /etc/grafana/provisioning/notifiers: no such file or directory”
grafana_1 | t=2021-10-20T06:49:02+0000 lvl=eror msg=“can’t read dashboard provisioning files from directory” logger=provisioning.dashboard path=/etc/grafana/provisioning/dashboards error=“open /etc/grafana/provisioning/dashboards: no such file or directory”

When I searched, I found dashboards (it has a YAML and JSON file) and data sources (has YAML file) folders on my laptop.

Is it possible to get hold of my dashboards?

Following is the code of my docker-compose.

version: ‘3.4’

networks:
k6:
grafana:

services:
influxdb:
image: influxdb:1.8
networks:
- k6
- grafana
ports:
- “8086:8086”
environment:
- INFLUXDB_DB=k6db

grafana:
image: grafana/grafana:latest
networks:
- grafana
ports:
- “3000:3000”
environment:
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_BASIC_ENABLED=false
volumes:
- ./grafana:/etc/grafana/provisioning/

k6:
image: loadimpact/k6:latest
networks:
- k6
ports:
- “6565:6565”
environment:
- K6_OUT=influxdb=http://influxdb:8086/k6
volumes:
- //c/testing:/src

1 Like

Hello,

I am facing the same issue did you solve it? Or you are still looking for help like me?

I have found the solution to this you just have to add default.yaml file beside ur dashboards inside the following folder /etc/grafana/provisioning/dashaboards

the file content is as following:

apiVersion: 1

providers:
  - name: Default
    folder: name-of-folder
    type: file
    options:
      path: apiVersion: 1

providers:
  - name: Default
    folder: Namla
    type: file
    options:
      path: # path to ur dashboard json file for example -> /etc/grafana/provisioning/dashboards/dashboard.json

you can read more on this here