-
What Grafana version and what operating system are you using?
-
We are on GCE vm hosted in GCP cloud. (Open source grafana version)
-
v8.0.6
-
Ubuntu Jammy 2204
-
What are you trying to achieve?
-
upgrade to latest version
-
How are you trying to achieve it?
-
we use salt as configuration management tool for grafana deb package installation.
-
What happened?
We are on free version of grafana.
When trying to upgrade our grafana version from v8.0.6 to any version v9 or v10.
When we tried to upgrade the grafan we are seeing below error message.
App mode production"
logger=sqlstore t=2024-09-17T02:10:38.969338919Z level=info msg="Connecting to DB" dbtype=postgres
logger=migrator t=2024-09-17T02:10:39.01827439Z level=info msg="Starting DB migrations"
logger=migrator t=2024-09-17T02:10:39.026655011Z level=info msg="Executing migration" id="dashboard permissions uid scopes"
logger=migrator t=2024-09-17T02:10:39.384600422Z level=error msg="Executing migration failed" id="dashboard permissions uid scopes" error="pq: duplicate key value violates unique constraint \"UQE_permission_action_scope_role_id\""
logger=migrator t=2024-09-17T02:10:39.384668278Z level=error msg="Exec failed" error="pq: duplicate key value violates unique constraint \"UQE_permission_action_scope_role_id\"" sql="code migration"
-
What did you expect to happen?
successful upgrade on existing grafana server.
-
Can you copy/paste the configuration(s) that you are having problems with?
-
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
no
- Did you follow any online instructions? If so, what is the URL?
upgrade one full version at a time
8 to 9 last version
9 to 10 last version
10 to 11
Hi @solitcon We have tried upgrading upgrading to below versions and ended up getting same error mentioned above in the request.
grafana_9.3.0_amd64.deb
grafana_9.5.0_amd64.deb
grafana-enterprise_9.5.0_amd64.deb
grafana_10.1.2_amd64.deb
grafana_10.4.3_amd64.deb
grafana_11.2.0_amd64.deb
Is there any specific versions you can suggest where can start upgrading from to start with.
I have tried with below v9 verisons and seeing same error.
V9 versions
- version=9.5.21
- version=9.0.0
Starting Grafana" version=9.5.21 commit=dd4eea5e9a9cbd5cc26e45a8cdf9782f80e4826a branch=HEAD compiled=2024-09-17T17:59:01Z
logger=migrator t=2024-09-17T17:59:02.488993697Z level=error msg="Executing migration failed" id="dashboard permissions uid scopes" error="pq: duplicate key value violates unique constraint \"UQE_permission_action_scope_role_id\""
logger=migrator t=2024-09-17T17:59:02.489309577Z level=error msg="Exec failed" error="pq: duplicate key value violates unique constraint \"UQE_permission_action_scope_role_id\"" sql="code migration"
logger=migrator t=2024-09-17T18:08:38.713867678Z level=info msg="Executing migration" id="dashboard permissions uid scopes"
logger=migrator t=2024-09-17T18:08:39.12254955Z level=error msg="Executing migration failed" id="dashboard permissions uid scopes" error="pq: duplicate key value violates unique constraint \"UQE_permission_action_scope_role_id\""
logger=migrator t=2024-09-17T18:08:39.122652057Z level=error msg="Exec failed" error="pq: duplicate key value violates unique constraint \"UQE_permission_action_scope_role_id\"" sql="code migration"
logger=settings t=2024-09-17T18:08:39.647528453Z level=info msg="Starting Grafana" version=9.0.0 commit=b5c56f6371 branch=HEAD compiled=2022-06-13T12:06:48Z
Quick update we were able to upgrade from v8.0.6 —> v8.5.27.
when tried to upgrade form v8.5.27 —> or v9.0.0 then same migration issue.
Starting DB migrations"
logger=migrator t=2024-09-17T18:24:11.705563321Z level=info msg="Executing migration" id="dashboard permissions uid scopes"
logger=migrator t=2024-09-17T18:24:12.145592287Z level=error msg="Executing migration failed" id="dashboard permissions uid scopes" error="pq: duplicate key value violates unique constraint \"UQE_permission_action_scope_role_id\""
logger=migrator t=2024-09-17T18:24:12.145902212Z level=error msg="Exec failed" error="pq: duplicate key value violates unique constraint \"UQE_permission_action_scope_role_id\"" sql="code migration"