amir20/dozzle · error

failed to load subscription

Error message

failed to load subscription %s: %w

What it means

HandleNotificationConfig applies a subscription's config via loadSubscription and, on failure, wraps the error with the subscription name. This means one named subscription had an invalid dispatcher reference or malformed rule config, aborting the whole notification state replacement.

Solutions

  1. Check the named subscription references an existing dispatcher id.
  2. Validate the subscription's rule/metric config fields against the schema.
  3. Fix or remove the offending subscription in notifications.yml and reload.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/notification/config.go:167 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07). Data as JSON: /api/errors/4d3da18241931378. Report an issue: GitHub.

Appendix: source

Thrown at internal/notification/config.go:167

				old.MetricCooldowns.Range(func(id string, t time.Time) bool {
					s.MetricCooldowns.Store(id, t)
					return true
				})
			}

			s.EventCooldowns = xsync.NewMap[string, time.Time]()
			if old.EventCooldowns != nil {
				old.EventCooldowns.Range(func(id string, t time.Time) bool {
					s.EventCooldowns.Store(id, t)
					return true
				})
			}

			// MetricSampleBuffers: start fresh since ring buffers can't be safely cloned
		}

		if err := m.loadSubscription(s); err != nil {
			return fmt.Errorf("failed to load subscription %s: %w", sub.Name, err)
		}
	}

	// Load dispatchers (cloud dispatchers are skipped; they are managed via cloud.yml)
	for _, dc := range dispatchers {
		if dc.Type == "cloud" {
			continue
		}
		d, err := createDispatcher(DispatcherConfig{
			ID:       dc.ID,
			Name:     dc.Name,
			Type:     dc.Type,
			URL:      dc.URL,
			Template: dc.Template,
			Headers:  dc.Headers,
		})
		if err != nil {
			log.Warn().Err(err).Str("name", dc.Name).Str("type", dc.Type).Msg("Skipping unknown dispatcher type")

View on GitHub (pinned to d9463cbe21)