thanos-io/thanos · error

no manager found for

Error message

no manager found for %v

What it means

Raised in Manager.Update: rule files were written for a PartialResponseStrategy, but m.mgrs has no rules.Manager registered for that strategy. This is an internal invariant violation — every strategy with staged files must have had a manager created during NewManager — typically caused by unsupported or misinitialized strategy configuration.

Solutions

  1. Ensure all PartialResponseStrategy values used by rule files have managers created at manager construction
  2. Check that callers pass only supported strategies
  3. Verify m.mgrs initialization was not skipped due to an earlier error
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/rules/manager.go:388 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/148cae63902703f5. Report an issue: GitHub.

Appendix: source

Thrown at pkg/rules/manager.go:388

			newFn := filepath.Join(m.workDir, s.String(), fn)
			if err := os.MkdirAll(filepath.Dir(newFn), os.ModePerm); err != nil {
				errs.Add(errors.Wrapf(err, "create %s", filepath.Dir(newFn)))
				continue
			}
			if err := os.WriteFile(newFn, b, os.ModePerm); err != nil {
				errs.Add(errors.Wrapf(err, "write file %v", newFn))
				continue
			}
			filesByStrategy[s] = append(filesByStrategy[s], newFn)
			ruleFiles[newFn] = fn
		}
	}

	m.mtx.Lock()
	for s, fs := range filesByStrategy {
		mgr, ok := m.mgrs[s]
		if !ok {
			errs.Add(errors.Errorf("no manager found for %v", s))
			continue
		}
		// We add external labels in `pkg/alert.Queue`.
		if err := mgr.Update(evalInterval, fs, m.extLset, m.externalURL, nil); err != nil {
			// TODO(bwplotka): Prometheus logs all error details. Fix it upstream to have consistent error handling.
			errs.Add(errors.Wrapf(err, "strategy %s, update rules", s))
			continue
		}
	}
	m.ruleFiles = ruleFiles
	m.mtx.Unlock()

	return errs.Err()
}

// Rules returns specified rules from manager. This is used by gRPC and locally for HTTP and UI purposes.
func (m *Manager) Rules(r *rulespb.RulesRequest, s rulespb.Rules_RulesServer) (err error) {
	groups := m.protoRuleGroups()

View on GitHub (pinned to 35b8b99117)