From 39621bb8dea088997f001f4ac6fdd00214e07a93 Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Tue, 17 Mar 2020 22:12:48 +0100 Subject: [PATCH] nixos/alertmanager: start after the network-online target If the host network stack is slow to start, the alertmanager fails to start with this error message: caller=main.go:256 msg="unable to initialize gossip mesh" err="create memberlist: Failed to get final advertise address: No private IP address found, and explicit IP not provided" This bug can be reproduced by shutting down the network stack and restarting the alertmanager. Note I don't know why I didn't hit this issue with previous alertmanager releases. --- nixos/modules/services/monitoring/prometheus/alertmanager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/prometheus/alertmanager.nix b/nixos/modules/services/monitoring/prometheus/alertmanager.nix index 4534d150885e..69e3dcf14085 100644 --- a/nixos/modules/services/monitoring/prometheus/alertmanager.nix +++ b/nixos/modules/services/monitoring/prometheus/alertmanager.nix @@ -155,7 +155,7 @@ in { systemd.services.alertmanager = { wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + after = [ "network-online.target" ]; preStart = '' ${lib.getBin pkgs.envsubst}/bin/envsubst -o "/tmp/alert-manager-substituted.yaml" \ -i "${alertmanagerYml}"