grafana-ansible-collection icon indicating copy to clipboard operation
grafana-ansible-collection copied to clipboard

Fix "Option '[alerting].enabled' cannot be true. Legacy Alerting is removed" on 11.0.0

Open michaelkebe opened this issue 1 year ago • 1 comments

When trying to upgrade from a previous grafana version to 11.0.0 the grafana-server service fails to start and the log of the grafana-server service says:

May 17 17:51:26 grafanaXXXXXXXX grafana[100358]: logger=settings t=2024-05-17T17:51:26.688716678+02:00 level=error msg="Option '[alerting].enabled' cannot be true. Legacy Alerting is removed. It is no longer deployed, enhanced, or supported. Delete '[alerting].enabled' and use '[unified_alerting].enabled' to enable Grafana Alerting. For more information, refer to the documentation on upgrading to Grafana Alerting (https://grafana.com/docs/grafana/v10.4/alerting/set-up/migrating-alerts)"

The template grafana.ini.j2 has a fixed alerting section:

# Alerting
[alerting]
{% if grafana_alerting != {} %}
enabled = true
{%   for k,v in grafana_alerting.items() %}
{%     if k != 'enabled' %}
{{ k }} = {{ v }}
{%     endif %}
{%   endfor %}
{% else %}
enabled = false
{% endif %}

Depending of the grafana version this has to be named ``[alerting]or[unified_alerting]`.

michaelkebe avatar May 17 '24 16:05 michaelkebe

I took a look at the source code. https://github.com/grafana/grafana-ansible-collection/blob/afba48928b2a59241b244e822a368f2f46c16cd1/roles/grafana/templates/grafana.ini.j2#L116

As a workaround, you can deploy with alerting disabled by defining grafana_alerting: {}

I validated this works in my own deployment.

If you need to enable Legacy Alerting, there's no way to do so presently I think.

velomatt avatar May 17 '24 21:05 velomatt

@michaelkebe could you please create PR?

voidquark avatar May 20 '24 09:05 voidquark

There is PR #203 open

intermittentnrg avatar May 21 '24 06:05 intermittentnrg

There is PR #203 open

Correct, there is a PR, but it is not ready because it hasn’t adjusted everything required.

voidquark avatar May 21 '24 08:05 voidquark