chenhg5/cc-connect · error

run_as_user startup checks failed for %d project(s); see log

Error message

run_as_user startup checks failed for %d project(s); see logs above

What it means

runRunAsUserStartupChecks collects per-project fatals and, if any exist, returns this summary error so startup aborts. It deliberately contains no detail; the specific causes were logged above as preflight/probe/audit FATAL lines.

Source

Thrown at cmd/cc-connect/runas_startup.go:155

				"project", o.project, "error", o.auditErr)
			fatals = append(fatals, fmt.Errorf("project %q probe: %w", o.project, o.auditErr))
			continue
		}
		slog.Info("run_as_user: isolation audit completed",
			"project", o.project,
			"whoami", o.audit.Identity.Whoami,
			"workdir_writable", o.audit.WorkDirStatus.Writable,
			"target_paths", len(o.audit.TargetPaths),
			"cross_user_results", len(o.audit.CrossUser),
		)
		for _, f := range o.audit.Fatal {
			slog.Error("run_as_user: audit FATAL", "project", o.project, "error", f)
			fatals = append(fatals, fmt.Errorf("project %q audit: %s", o.project, f))
		}
	}

	if len(fatals) > 0 {
		return fmt.Errorf("run_as_user startup checks failed for %d project(s); see logs above", len(fatals))
	}
	return nil
}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Scroll up in the logs for lines prefixed 'run_as_user: preflight FATAL', 'isolation probe failed to run', or 'audit FATAL'.
  2. Fix each named project's underlying issue (see those specific errors).
  3. Restart cc-connect; startup succeeds only when zero projects fail.

Example fix

// before
journalctl -u cc-connect | tail -n 20  # only sees summary
// after
journalctl -u cc-connect | grep 'run_as_user'  # find per-project FATAL causes
Defensive patterns

Strategy: try-catch

Validate before calling

systemd-analyze verify cc-connect.service && journalctl -u cc-connect | grep -c 'run_as_user'

Try / catch

if err := runRunAsUserStartupChecks(ctx); err != nil {
    slog.Error("run_as_user startup aborted", "err", err)
    // inspect logs above for per-project FATAL lines before retrying
    os.Exit(1)
}

Prevention

When it happens

Trigger: Any project produced a preflight fatal, a probe failure, or an audit fatal during run_as_user startup — the count in the message equals the number of failing projects.

Common situations: First deployment of run_as_user mode with misconfigured permissions across one or more projects; after OS/user changes broke a previously working isolation setup.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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