AdguardTeam/AdGuardHome · error

reloading service: %w

Error message

reloading service: %w

What it means

The service manager's Reload call failed while trying to make the running service re-read its configuration. This wraps whatever error the underlying OS service layer (systemd, launchd, sc.exe, etc.) returned, such as the service not being loaded, insufficient privileges, or a unit file problem.

Source

Thrown at internal/home/service.go:297

		l.InfoContext(ctx, "running")
	case ossvc.StatusRestartOnFail:
		l.InfoContext(ctx, "restarting after failed start")
	}

	return nil
}

// handleServiceReloadCmd reloads the service, if it's running.  l must not be
// nil, mgr must be a ReloadManager.
func handleServiceReloadCmd(ctx context.Context, l *slog.Logger, mgr ossvc.Manager) (err error) {
	relSvcMgr, ok := mgr.(ossvc.ReloadManager)
	if !ok {
		return fmt.Errorf("service manager can't reload: %w", errors.ErrUnsupported)
	}

	err = relSvcMgr.Reload(ctx, serviceName)
	if err != nil {
		return fmt.Errorf("reloading service: %w", err)
	}

	l.InfoContext(ctx, "service reloaded successfully")

	return nil
}

// handleServiceInstallCmd handles the service "install" command.  l must
// not be nil.
func handleServiceInstallCmd(
	ctx context.Context,
	l *slog.Logger,
	mgr ossvc.Manager,
	opts options,
	workDir string,
	confPath string,
) (err error) {
	pwd, err := os.Getwd()

View on GitHub (pinned to b41aefbe51)

Solutions

  1. Verify the service is actually installed and running before reloading
  2. Re-run the command with root/administrator privileges
  3. Inspect the OS service manager status (systemctl status AdGuardHome / sc query) for the underlying cause
  4. Repair or reinstall the service via the 'install' action

Example fix

// before
err = relSvcMgr.Reload(ctx, serviceName)
if err != nil {
	return fmt.Errorf("reloading service: %w", err)
}

// after (caller-side resilience)
err = relSvcMgr.Reload(ctx, serviceName)
if err != nil {
	l.WarnContext(ctx, "reload failed, falling back to restart", "error", err)
	err = mgr.Perform(ctx, &ossvc.ActionRestart{ServiceName: serviceName})
}
Defensive patterns

Strategy: fallback

Try / catch

// after
if err := relSvcMgr.Reload(ctx, serviceName); err != nil {
    log.Warn("reload failed", "err", err)
    err = mgr.Perform(ctx, &ossvc.ActionRestart{ServiceName: serviceName})
    if err != nil { return err }
}

Prevention

When it happens

Trigger: Calling handleServiceReloadCmd when the service is not running or not installed; reloading without root/admin privileges; a broken or missing service unit/configuration on disk.

Common situations: 'AdGuardHome -s reload' run as a non-root user; systemd unit in a failed state; service was uninstalled while its definition lingered; config file path changed so the manager can't signal the daemon.

Related errors


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