chenhg5/cc-connect · error

restart: %s (%w)

Error message

restart: %s (%w)

What it means

launchdManager.Restart wraps the final bootstrap failure after 3 attempts with 500ms backoff (bootout is asynchronous, causing 'Bootstrap failed: 5' races); the restart aborts before kickstart, leaving the service unloaded.

Source

Thrown at daemon/launchd.go:154

	bootoutLaunchdTargets()

	plistPath := launchdPlistPath()

	// launchd bootout is asynchronous; retry bootstrap with backoff
	// to avoid "Bootstrap failed: 5" race condition.
	var out string
	var err error
	for i := 0; i < 3; i++ {
		if i > 0 {
			time.Sleep(500 * time.Millisecond)
		}
		out, err = runLaunchctl("bootstrap", domain, plistPath)
		if err == nil {
			break
		}
	}
	if err != nil {
		return fmt.Errorf("restart: %s (%w)", out, err)
	}
	if _, err := runLaunchctl("kickstart", "-kp", target); err != nil {
		return fmt.Errorf("restart kickstart: %w", err)
	}
	return nil
}

func (*launchdManager) Status() (*Status, error) {
	st := &Status{Platform: "launchd"}

	plistPath := launchdPlistPath()
	if _, err := os.Stat(plistPath); err != nil {
		return st, nil
	}
	st.Installed = true

	_, _, out, ok := loadedLaunchdTarget()
	if !ok {

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Retry the restart; the async bootout usually completes shortly
  2. Verify with Status/bootout list that the job actually unloaded
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at daemon/launchd.go:154 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/b5545ec758a40974. Report an issue: GitHub.