Grafana Loki: no useable address found for interfaces [eth0 en0 lo]

Hello, I am trying to configure Grafana with Loki on NixOS, using inmemory kvstore. I have the example config from: Configuration | Grafana Loki documentation

For some reason it seems Loki is still trying to setup memberlist, and therefore I get this error no matter what I try:

Oct 02 22:13:04 nixos loki[189084]: no useable address found for interfaces [eth0 en0 lo]
Oct 02 22:13:04 nixos loki[189084]: error initialising module: memberlist-kv

If anybody has had any success setting up something similar, please help me out!

1 Like

Loki tries to detect ip addresses to run the memberlist on based on a bunch of common interface names. The hard coded interface names it tries to check are eth0, en0 and lo. Since those are not present in a standard NixOS configurion (except lo), you have to tell loki the interface names to look for.

The easiest way to do that is to get the interface names using the nixos option networking.interfaces and set it in the loki configuration:

services.loki.configuration.common.instance_interface_names = builtins.attrNames config.networking.interfaces;

Here is a working nixos loki configuration in case you need a bit more context:

nixos loki configuration
services.loki = {
  enable = true;

  configuration = {
    analytics.reporting_enabled = false;

    auth_enabled = false;

    common = {
      path_prefix = config.services.loki.dataDir;
      replication_factor = 1;
      instance_interface_names = builtins.attrNames config.networking.interfaces;
      ring = {
        instance_addr = "127.0.0.1";
        kvstore.store = "inmemory";
      };
    };

    schema_config = {
      configs = [
        {
          from = "2025-11-01";
          object_store = "filesystem";
          schema = "v13";
          store = "tsdb";
          index = {
            prefix = "index_";
            period = "24h";
          };
        }
      ];
    };

    server = {
      http_listen_port = 3002;
      http_path_prefix = "/loki";
      grpc_listen_port = 9096;
    };

    storage_config.filesystem.directory = "${config.services.loki.dataDir}/chunks";
  };
};

Open Questions I don’t have an answer to:

  • The local loopback interface lo is present on a standard NixOS machine. I don’t know why loki is unable to detect that.
  • The minimal loki configuration example contains kvstore.store = "inmemory";. I would have assumed that you don’t need a memberlist at all with this setting. Thus, I’m still unsure why loki tries to start one with the kvstore set to in memory.
2 Likes

Thank you for your answer! I will check out your suggestion and see if that fixes my problem.

Edit: I tried your example config, with some minor changes, and it worked! Greatly appreciated!

1 Like