{"record":{"id":"9c4e2b17b294ca37","repo":"amir20/dozzle","slug":"failed-to-decode-config-w","errorCode":null,"errorMessage":"failed to decode config: %w","messagePattern":"failed to decode config: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/notification/config.go","lineNumber":44,"sourceCode":"\n\tconfig := Config{\n\t\tSubscriptions: m.Subscriptions(),\n\t\tDispatchers:   dispatchers,\n\t}\n\n\tencoder := yaml.NewEncoder(w)\n\tdefer encoder.Close()\n\n\treturn encoder.Encode(config)\n}\n\n// LoadConfig reads configuration from a reader in YAML format and loads it\nfunc (m *Manager) LoadConfig(r io.Reader) error {\n\tvar config Config\n\n\tdecoder := yaml.NewDecoder(r)\n\tif err := decoder.Decode(&config); err != nil {\n\t\treturn fmt.Errorf(\"failed to decode config: %w\", err)\n\t}\n\n\t// Convert to types for HandleNotificationConfig\n\tsubscriptions := make([]types.SubscriptionConfig, len(config.Subscriptions))\n\tfor i, sub := range config.Subscriptions {\n\t\tsubscriptions[i] = types.SubscriptionConfig{\n\t\t\tID:                  sub.ID,\n\t\t\tName:                sub.Name,\n\t\t\tEnabled:             sub.Enabled,\n\t\t\tDispatcherID:        sub.DispatcherID,\n\t\t\tLogExpression:       sub.LogExpression,\n\t\t\tContainerExpression: sub.ContainerExpression,\n\t\t\tMetricExpression:    sub.MetricExpression,\n\t\t\tEventExpression:     sub.EventExpression,\n\t\t\tCooldown:            sub.Cooldown,\n\t\t\tSampleWindow:        sub.SampleWindow,\n\t\t}\n\t}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/notification/config.go#L26-L62","documentation":"LoadConfig decodes the notifications YAML from disk and wraps any YAML syntax or schema error. The file at ./data/notifications.yml is malformed (bad indentation, wrong types, or invalid YAML), so no notification state is loaded and the persisted config is effectively unusable until fixed.","triggerScenarios":"Thrown at internal/notification/config.go:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the YAML file syntax (indentation, colons, quoting) with a linter.","Check that field types match Config (e.g. dispatcher ids are ints, subscriptions are lists).","Restore the file from a backup or delete it to reset notification state; it is regenerated on next save."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}