Provisioning in multiple folders : [error] cannot read directory

Hi,
I’m actually using Grafana latest version and i want to have my dashboard to be preloaded.
I saved my dashboards in different folders ( before doing the provisioning ) and i want to keep this hierarchy.
So i did this configurations below in both my docker-compose.yml and dashboards.yml:

  • docker-compose.yml

grafana:
build: ./grafana
container_name: wis_grafana
ports:
- “3000:3000”
volumes:
- ./grafana-data:/var/lib/grafana
- ./grafana/defaults.ini:/usr/share/grafana/conf/defaults.ini
- ./grafana/provisioning:/etc/grafana/provisioning
environment:
GF_INSTALL_PLUGINS: grafana-piechart-panel,grafana-simple-json-datasource
GF_PATHS_PROVISIONING: /etc/grafana/provisioning
user: “104”

  • dashboards.yml :

    apiVersion: 1

    providers:
    - name: ‘People’
    orgId: 1
    folder: ‘People’
    type: file
    disableDeletion: true
    editable: false
    updateIntervalSeconds: 3600
    options:
    path: /etc/grafana/provisioning/dashboards/people

    - name: 'Partner Details People'
      orgId: 1
      folder: 'People'
      type: file
      disableDeletion: true
      editable: false
      updateIntervalSeconds: 3600
      options:
        path: /etc/grafana/provisioning/dashboards/people
    
    - name: 'Premium'
      orgId: 1
      folder: 'Premium'
      type: file
      disableDeletion: true
      editable: false
      updateIntervalSeconds: 3600
      options:
        path: /etc/grafana/provisioning/dashboards/premium
    
    - name: 'Partner Details Premium'
      orgId: 1
      folder: 'Premium'
      type: file
      disableDeletion: true
      editable: false
      updateIntervalSeconds: 3600
      options:
        path: /etc/grafana/provisioning/dashboards/premium
    

Despite of this configurations , i’m having this error :
cannot read directory : stat /etc/grafana/provisioning/dashboards/people: no such file or directory
i even tried to create those folders through a Dockerfile but in vain , Grafana can’t simply find those folders.
Thanks for your help.

For anyone stucked in this issue , I solved it by handling the adding of dashboards provisioning files inside a Dockerfile like this example:

ADD ./provisioning/datasources/datasource.yml /etc/grafana/provisioning/datasources/datasource.yml
ADD ./provisioning/dashboards/dashboard_premium.json /etc/grafana/provisioning/dashboards/premium/dashboard_premium.json
ADD ./provisioning/dashboards/dashboard_people.json /etc/grafana/provisioning/dashboards/premium/dashboard_people.json

I removed the mounting volume line of the provisioning folder from docker-compose file and then it worked like a charm.

2 Likes