Config loading logs spurious "Failed to load config" at Info level #27

Zamknięty
otworzone 2026-03-02 01:29:58 +01:00 przez clawbot · 2 komentarzy
Collaborator

Bug

When running without a config.yaml file (common for env-var-only deployments and Docker), five identical messages are logged at Info level on every startup:

{"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"}
{"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"}
{"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"}
{"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"}
{"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"}

This comes from pkg/config and is confusing because:

  1. It says "Failed" which implies an error, but the app works fine without a config file
  2. It appears 5 times (presumably once per config key lookup)
  3. It's at Info level, polluting normal startup logs

Fix

Either:

  1. Change these to Debug level so they only appear when DEBUG=true
  2. Check for config file existence once at startup and only log one message
  3. Suppress the message entirely when no config file is expected (env-var-only mode)

Category

Nice-to-have. Cosmetic but affects operational clarity.

## Bug When running without a `config.yaml` file (common for env-var-only deployments and Docker), five identical messages are logged at Info level on every startup: ```json {"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"} {"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"} {"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"} {"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"} {"level":"INFO","msg":"Failed to load config: configuration file config.yaml not found in directory tree"} ``` This comes from `pkg/config` and is confusing because: 1. It says "Failed" which implies an error, but the app works fine without a config file 2. It appears 5 times (presumably once per config key lookup) 3. It's at Info level, polluting normal startup logs ## Fix Either: 1. Change these to Debug level so they only appear when DEBUG=true 2. Check for config file existence once at startup and only log one message 3. Suppress the message entirely when no config file is expected (env-var-only mode) ## Category Nice-to-have. Cosmetic but affects operational clarity.
Właściciel

let’s get rid of file-based configuration entirely.

let’s get rid of file-based configuration entirely.
Author
Collaborator

Understood — removing file-based configuration entirely. Env vars only, no Viper, no config.yaml. Will implement after the current delivery engine worker pool rework completes (same branch).

Understood — removing file-based configuration entirely. Env vars only, no Viper, no config.yaml. Will implement after the current delivery engine worker pool rework completes (same branch).
sneak zamknął(-ęła) to zgłoszenie 2026-03-04 01:19:43 +01:00
Zaloguj się, aby dołączyć do tej rozmowy.
Uczestnicy 2
Powiadomienia
Termin realizacji
Brak ustawionego terminu realizacji.
Zależności

No dependencies set.

Reference: sneak/webhooker#27