Grafana (Docker) no longer starts, panics about alerts migration

My Grafana instance (8.x) isn’t starting anymore, I think it panics on a rules migration. I’ve tried to set GF_FORCE_MIGRATION to true in the docker env variable but it doesn’t help:

grafana               | panic: New alert rules created while using unified alerting will be deleted, set force_migration=true in your grafana.ini and try again if this is okay.
grafana               |
grafana               | goroutine 1 [running]:
grafana               |
grafana               |         /drone/src/pkg/services/sqlstore/migrations/ualert/ualert.go:78 +0x797
grafana               |*OSSMigrations).AddMigration(0xc000d2c0e0, 0xc000d36550)
grafana               |         /drone/src/pkg/services/sqlstore/migrations/migrations.go:61 +0x265
grafana               |*SQLStore).Migrate(0xc00011a900, 0x0)
grafana               |         /drone/src/pkg/services/sqlstore/sqlstore.go:135 +0x6f
grafana               |, 0x18, {0x36eff40, 0x5760838}, {0x3715a80, 0xc000d36190})
grafana               |         /drone/src/pkg/services/sqlstore/sqlstore.go:67 +0xdc
grafana               |{{0x7ffd8d04ab1d, 0x18}, {0x7ffd8d04ab01, 0x12}, {0xc000126040, 0x5, 0x5}}, {{0x0, 0x0}, {0x0, ...}, ...}, ...)
grafana               |         /drone/src/pkg/server/wire_gen.go:148 +0x1b6
grafana               |{0x7ffd8d04ab1d, 0x18}, {0x7ffd8d04ab01, 0x12}, {0x0, 0x0}, {0x7ffd8d04ab42, 0x6}, 0x0, {{0x36713e0, ...}, ...})
grafana               |         /drone/src/pkg/cmd/grafana-server/commands/cli.go:170 +0x625
grafana               |{{0x36713e0, 0x5}, {0x3672d38, 0xa}, {0x36713d8, 0x4}, {0x3672d28, 0xa}})
grafana               |         /drone/src/pkg/cmd/grafana-server/commands/cli.go:107 +0x785
grafana               | main.main()
grafana               |         /drone/src/pkg/cmd/grafana-server/main.go:16 +0xc5
grafana exited with code 2

Any idea what could be happening? I don’t care much about the alerts so I am fine removing them altogether

Solved by using docker cp to copy /usr/local/etc/grafana/grafana.ini locally, edit it then place it back and restart it.

1 Like

Note that you can also use the environment variable:

GF_DEFAULT_FORCE_MIGRATION and set it to true like this:


Note the DEFAULT prefix as “force_migration” is inside the default section!
You can find that information here:

1 Like