docker-composegelfdocker-logsdatalust-seq

Datalust Seq Ingestion failed: Invalid URI: The URI scheme is not valid


I'm trying to collect logs from docker containers by Datalust Seq.
All containers are running on the same host. I tried to follow the official recomendations.

  seq:
    image: datalust/seq:latest
    container_name: seq
    restart: unless-stopped
    environment:
      - ACCEPT_EULA=Y
    ports:
      - "81:80"
      - "5341:5341"
    volumes:
      - seq-logs:/data

  seq-gelf:
    image: datalust/seq-input-gelf:latest
    container_name: seq-gelf
    restart: unless-stopped
    environment:
      - ACCEPT_EULA=Y
      - GELF_ENABLE_DIAGNOSTICS=True
      - SEQ_ADDRESS="http://seq:5341"
            # Same errors with:
            # - SEQ_ADDRESS="seq:5341"
            # - SEQ_ADDRESS="http://host.docker.internal:5341"
            # - SEQ_ADDRESS="http://localhost:5341"
            # - SEQ_ADDRESS="localhost:5341"
            # - SEQ_ADDRESS="127.0.0.1:5341"
    depends_on:
      - seq
    ports:
      - "12201:12201/udp"

nginx:
    ...
    logging:
        driver: "gelf"
        options:
          gelf-address: "udp://host.docker.internal:12201"
            # gelf-address: "udp://seq-gelf:12201" 

Error message in seq-gelf (repeated):

Ingestion failed: Invalid URI: The URI scheme is not valid.
System.UriFormatException: Invalid URI: The URI scheme is not valid.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString)
   at Seq.Api.Client.SeqApiClient..ctor(String serverUrl, String apiKey, Action`1 configureHttpClientHandler)
   at Seq.Api.SeqConnection..ctor(String serverUrl, String apiKey, Action`1 configureHttpClientHandler)
   at SeqCli.Connection.SeqConnectionFactory.Connect(ConnectionFeature connection) in /home/appveyor/projects/seqcli/src/SeqCli/Connection/SeqConnectionFactory.cs:line 36
   at SeqCli.Cli.Commands.IngestCommand.Run() in /home/appveyor/projects/seqcli/src/SeqCli/Cli/Commands/IngestCommand.cs:line 96
thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1193:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
{"@t":"2022-05-24T07:18:41.833597300Z","@l":"ERROR","@mt":"GELF input failed","@x":"failed printing to stdout: Broken pipe (os error 32)"}

Do I understand correctly that the error "Invalid URI: The URI scheme is not valid" means that seq-gelp cannot find the seq service?

Looks like the seq container itself works fine:

[INF] Seq "2022.1.7449" running on OS "Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022"
[INF] Seq detected 6543.028224 MB of RAM
[INF] Opening event store at "/data/Stream/stream.flare"
[INF] Ingestion enabled
[INF] Opening metastore "/data/Documents/metastore.flare"
[INF] Storage subsystem available
[INF] Seq listening on ["http://localhost/", "https://localhost/", "http://localhost:5341/", "https://localhost:45341/"]
[INF] 1 more generation 2 garbage collection(s) occurred
[INF] Metrics sampled
[INF] Metrics sampled
[INF] Applying 0 retention policies
[INF] Retention processing and compaction took 16.2288 ms; allocating 599983.7712 ms for indexing

I can connect to its web interface (with no captured events inside).

What's wrong with my config?


Solution

  • The problem was in quotation marks. So instead of

    environment:
      - SEQ_ADDRESS="http://seq:5341"  # this syntax is wrong
    

    It should be:

    environment:
      - SEQ_ADDRESS=http://seq:5341
    

    or

    environment:
      SEQ_ADDRESS: "http://seq:5341"