{"record":{"id":"b23b08d08c28c932","repo":"chenhg5/cc-connect","slug":"run-as-user-startup-checks-failed-for-d-project-s","errorCode":null,"errorMessage":"run_as_user startup checks failed for %d project(s); see logs above","messagePattern":"run_as_user startup checks failed for (.+?) project\\(s\\); see logs above","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/runas_startup.go","lineNumber":155,"sourceCode":"\t\t\t\t\"project\", o.project, \"error\", o.auditErr)\n\t\t\tfatals = append(fatals, fmt.Errorf(\"project %q probe: %w\", o.project, o.auditErr))\n\t\t\tcontinue\n\t\t}\n\t\tslog.Info(\"run_as_user: isolation audit completed\",\n\t\t\t\"project\", o.project,\n\t\t\t\"whoami\", o.audit.Identity.Whoami,\n\t\t\t\"workdir_writable\", o.audit.WorkDirStatus.Writable,\n\t\t\t\"target_paths\", len(o.audit.TargetPaths),\n\t\t\t\"cross_user_results\", len(o.audit.CrossUser),\n\t\t)\n\t\tfor _, f := range o.audit.Fatal {\n\t\t\tslog.Error(\"run_as_user: audit FATAL\", \"project\", o.project, \"error\", f)\n\t\t\tfatals = append(fatals, fmt.Errorf(\"project %q audit: %s\", o.project, f))\n\t\t}\n\t}\n\n\tif len(fatals) > 0 {\n\t\treturn fmt.Errorf(\"run_as_user startup checks failed for %d project(s); see logs above\", len(fatals))\n\t}\n\treturn nil\n}\n","sourceCodeStart":137,"sourceCodeEnd":159,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/runas_startup.go#L137-L159","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Scroll up in the logs for lines prefixed 'run_as_user: preflight FATAL', 'isolation probe failed to run', or 'audit FATAL'.","Fix each named project's underlying issue (see those specific errors).","Restart cc-connect; startup succeeds only when zero projects fail."],"exampleFix":"// before\njournalctl -u cc-connect | tail -n 20  # only sees summary\n// after\njournalctl -u cc-connect | grep 'run_as_user'  # find per-project FATAL causes","handlingStrategy":"try-catch","validationCode":"systemd-analyze verify cc-connect.service && journalctl -u cc-connect | grep -c 'run_as_user'","typeGuard":null,"tryCatchPattern":"if err := runRunAsUserStartupChecks(ctx); err != nil {\n    slog.Error(\"run_as_user startup aborted\", \"err\", err)\n    // inspect logs above for per-project FATAL lines before retrying\n    os.Exit(1)\n}","preventionTips":["Grep logs for 'run_as_user' to see per-project causes; this error is only a summary.","Fix all failing projects before restart — startup aborts on any fatal.","Add startup checks to deployment smoke tests."],"tags":["go","startup","aggregate-error","run-as-user"],"backgroundTag":"invalid-state-transition","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}