{"record":{"id":"e15ab892a17478fe","repo":"chenhg5/cc-connect","slug":"config-s-run-as-user-must-not-be-root","errorCode":null,"errorMessage":"config: %s.run_as_user must not be root","messagePattern":"config: (.+?)\\.run_as_user must not be root","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":72,"sourceCode":"func validateRunAsEnv(prefix string, envVars []string) error {\n\tfor _, v := range envVars {\n\t\tname := strings.TrimSpace(v)\n\t\tif dangerousEnvVars[strings.ToUpper(name)] {\n\t\t\treturn fmt.Errorf(\"config: %s.run_as_env must not include dangerous variable %q\", prefix, name)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateRunAsUser(prefix, name string) error {\n\tif name == \"\" {\n\t\treturn nil\n\t}\n\tif runtime.GOOS == \"windows\" {\n\t\treturn fmt.Errorf(\"config: %s.run_as_user is only supported on Linux/macOS\", prefix)\n\t}\n\tif name == \"root\" || name == \"0\" {\n\t\treturn fmt.Errorf(\"config: %s.run_as_user must not be root\", prefix)\n\t}\n\tif !isValidRunAsUserName(name) {\n\t\treturn fmt.Errorf(\"config: %s.run_as_user %q contains invalid characters (allowed: a-z, A-Z, 0-9, -, _, .; must start with a letter or underscore)\", prefix, name)\n\t}\n\treturn nil\n}\n\n// configMu serializes read-modify-write cycles to prevent lost updates.\nvar configMu sync.Mutex\n\n// ConfigPath stores the path to the config file for saving\nvar ConfigPath string\n\ntype Config struct {\n\tDataDir        string `toml:\"data_dir\"` // session store directory, default ~/.cc-connect\n\tAttachmentSend string `toml:\"attachment_send\"`\n\t// Quiet is legacy: when true and [display] does not set thinking_messages / tool_messages,\n\t// engines behave as if those flags were false. Per-project quiet overrides when set.","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L54-L90","documentation":"A config validation error from validateRunAsUser: the configured run_as_user is 'root' or UID 0. Running agent subprocesses as root defeats the privilege-separation purpose and is explicitly refused; config load aborts with the prefix identifying the offending section.","triggerScenarios":"Thrown at config/config.go:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a dedicated non-root user for run_as_user","Grant that user the minimal permissions the agents need","Remove run_as_user if isolation is not needed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}