Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folder Provisioning: Error while provisioning already existing folders #87889

Open
jad-gha opened this issue May 15, 2024 · 4 comments
Open

Folder Provisioning: Error while provisioning already existing folders #87889

jad-gha opened this issue May 15, 2024 · 4 comments

Comments

@jad-gha
Copy link

jad-gha commented May 15, 2024

What happened?

Error: ✗ *provisioning.ProvisioningServiceImpl run error: Failed to provision dashboards: failed to provision config alerting: a folder with the same name already exists in the current location

What did you expect to happen?

I expect the provisioning to ignore or overwrite the existing folder.

Did this work before?

Yes, I'm trying to upgrade from v.10.4.1 --> 11.0.0.
Provisioning works perfectly on previous versions.

How do we reproduce it?

I'm using a docker-compose

grafana:
image: grafana/grafana:11.0.0
container_name: grafana
ports:
- 3000:3000
volumes:
- /host/data/grafana/:/var/lib/grafana:rw
- /host/data/grafana/provisioning/:/etc/grafana/provisioning/
- /host/data/grafana/grafana.ini:/etc/grafana/grafana.ini
restart: unless-stopped

In host/data/grafana/provisioning/ - I have :

dashboards/alerting.yml :
apiVersion: 1

providers:

  • name: alerting
    orgId: 1
    folder: 'Alerting'
    folderUid: 'rIDmUF1'
    type: file
    disableDeletion: true
    editable: true
    allowUiUpdates: true
    updateIntervalSeconds: 60
    options:
    path: /var/lib/grafana/json/alerting

In host/data/grafana/json/ - I have :
alerting/*.json

  1. Provision a folder on 10.4.1 version (or older)
  2. Wait till Grafana starts up
  3. upgrade to 11.0.0

Is the bug inside a dashboard panel?

no

Environment (with versions)?

Grafana: 11.0.0
OS: Docker compose

Grafana platform?

Docker

Datasource(s)?

No response

@naiin
Copy link

naiin commented May 21, 2024

Hi, I am facing the same issue did you find a solution ?

@jad-gha
Copy link
Author

jad-gha commented May 21, 2024

Hello,
Yes the solution is the following file structure to provision folder :

apiVersion: 1

providers:
  - name: alerting
    orgId: 1
    folder: ''  <== empty
    folderUid: '' <== empty
    type: file
    disableDeletion: true
    editable: true
    allowUiUpdates: true
    updateIntervalSeconds: 60
    options:
      foldersFromFilesStructure: true  <== add this 
      path: /var/lib/grafana/json/[name]

@ravindrajob
Copy link

I had the same issue, and the solution provided by jad-gha worked. Thank you!

@csantiagoo
Copy link

csantiagoo commented May 22, 2024

Solution of @jad-gha worked for us as well. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants