{"record":{"id":"ff83d27e8009c93d","repo":"yudai/gotty","slug":"failed-to-start-command-s","errorCode":null,"errorMessage":"failed to start command `%s`","messagePattern":"failed to start command `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/localcommand/local_command.go","lineNumber":37,"sourceCode":"type LocalCommand struct {\n\tcommand string\n\targv    []string\n\n\tcloseSignal  syscall.Signal\n\tcloseTimeout time.Duration\n\n\tcmd       *exec.Cmd\n\tpty       *os.File\n\tptyClosed chan struct{}\n}\n\nfunc New(command string, argv []string, options ...Option) (*LocalCommand, error) {\n\tcmd := exec.Command(command, argv...)\n\n\tpty, err := pty.Start(cmd)\n\tif err != nil {\n\t\t// todo close cmd?\n\t\treturn nil, errors.Wrapf(err, \"failed to start command `%s`\", command)\n\t}\n\tptyClosed := make(chan struct{})\n\n\tlcmd := &LocalCommand{\n\t\tcommand: command,\n\t\targv:    argv,\n\n\t\tcloseSignal:  DefaultCloseSignal,\n\t\tcloseTimeout: DefaultCloseTimeout,\n\n\t\tcmd:       cmd,\n\t\tpty:       pty,\n\t\tptyClosed: ptyClosed,\n\t}\n\n\tfor _, option := range options {\n\t\toption(lcmd)\n\t}","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/yudai/gotty/blob/a080c85cbc59226c94c6941ad8c395232d72d517/backend/localcommand/local_command.go#L19-L55","documentation":"Wrapped pty.Start error in LocalCommand.New: the configured command could not be launched under a pseudo-terminal — commonly exec not-found, exec permission denied, or PTY allocation failure. The command name is interpolated into the message; a known todo notes the half-started cmd may leak.","triggerScenarios":"Thrown at backend/localcommand/local_command.go:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the command exists in the server's PATH and is executable","Check ulimit/process limits if PTY allocation is the failing step","Ensure cmd.Wait/Process cleanup runs on start failure to avoid zombie processes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a080c85cbc59226c94c6941ad8c395232d72d517","analyzedAt":"2026-09-02T16:42:38.150Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}