AdguardTeam/AdGuardHome · critical

creating config manager: %w

Error message

creating config manager: %w

What it means

Creating the config manager (configmgr.New) failed during service startup; the inner error comes from the config manager subsystem (loading/parsing configuration, setting up DNS/web handlers).

Source

Thrown at internal/next/cmd/service.go:45

}

// serviceMgrConfig contains service manager configuration parameters.
type serviceMgrConfig struct {
	// confMgrConf is the configuration manager config, it must not be nil.
	confMgrConf *configmgr.Config

	// logger is the logger used to log services activity, it must not be nil.
	logger *slog.Logger

	// pidFilePath is the path to the file where to store the PID, if any.
	pidFilePath string
}

// newServiceMgr creates a new *serviceMgr.
func newServiceMgr(ctx context.Context, conf *serviceMgrConfig) (s *serviceMgr, err error) {
	confMgr, err := configmgr.New(ctx, conf.confMgrConf)
	if err != nil {
		return nil, fmt.Errorf("creating config manager: %w", err)
	}

	return &serviceMgr{
		confMgr:     confMgr,
		confMgrMu:   &sync.RWMutex{},
		confMgrConf: conf.confMgrConf,
		logger:      conf.logger,
		pidFilePath: conf.pidFilePath,
	}, nil
}

// type check
var _ service.Interface = (*serviceMgr)(nil)

// Start implements the [service.Interface] interface for *serviceMgr.
func (s *serviceMgr) Start(ctx context.Context) (err error) {
	s.writePID(ctx)

View on GitHub (pinned to b41aefbe51)

Solutions

  1. Check the inner error and the config file at the reported path
  2. Validate YAML syntax (yamllint / yaml round-trip)
  3. Restore a known-good backup of the config
Defensive patterns

Strategy: try-catch

Validate before calling

if _, err := os.Stat(conf.ConfigPath); err != nil {
	log.Fatalf("config file problem: %v", err)
}

Try / catch

s, err := newServiceMgr(ctx, conf)
if err != nil {
	log.Printf("startup failed: %v", errors.Unwrap(err))
	os.Exit(1)
}

Prevention

When it happens

Trigger: newServiceMgr calls configmgr.New with conf.confMgrConf; failure of any subordinate initialization (bad YAML, unreadable working dir, invalid settings) surfaces here.

Common situations: Malformed AdGuard Home YAML, schema/validation errors after an upgrade, unreadable files due to permissions.

Related errors


AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27). Data as JSON: /api/errors/8713dbe2c8100926. Report an issue: GitHub.