{"record":{"id":"2b451f6440eb6a46","repo":"wavetermdev/waveterm","slug":"failed-to-create-stderr-pipe-w","errorCode":null,"errorMessage":"failed to create stderr pipe: %w","messagePattern":"failed to create stderr pipe: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/blockcontroller/tsunamicontroller.go","lineNumber":318,"sourceCode":"\t\tcmd.Env = append(cmd.Env, \"TSUNAMI_CORS=\"+tsunamiutil.DevModeCorsOrigins)\n\t}\n\n\t// Add TsunamiEnv variables if configured\n\ttsunamiEnv := blockMeta.GetMap(waveobj.MetaKey_TsunamiEnv)\n\tfor key, value := range tsunamiEnv {\n\t\tif strValue, ok := value.(string); ok {\n\t\t\tcmd.Env = append(cmd.Env, key+\"=\"+strValue)\n\t\t}\n\t}\n\n\tstdoutPipe, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create stdout pipe: %w\", err)\n\t}\n\n\tstderrPipe, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create stderr pipe: %w\", err)\n\t}\n\n\tstdinPipe, err := cmd.StdinPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create stdin pipe: %w\", err)\n\t}\n\n\tappName := build.GetAppName(appPath)\n\n\tlineBuffer := utilds.MakeMultiReaderLineBuffer(1000)\n\tportChan := make(chan int, 1)\n\tportFound := false\n\n\tlineBuffer.SetLineCallback(func(line string) {\n\t\tlog.Printf(\"[tsunami:%s] %s\\n\", appName, line)\n\n\t\tif !portFound {\n\t\t\tif port := build.ParseTsunamiPort(line); port > 0 {","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/blockcontroller/tsunamicontroller.go#L300-L336","documentation":"cmd.StderrPipe() failed while wiring the tsunami app's process streams; the app cannot be started because its stderr cannot be captured. Same root cause family as stdout pipe failure: OS-level pipe/fd allocation failure.","triggerScenarios":"runTsunamiAppBinary calls cmd.StderrPipe() and it errors — practically only fd exhaustion or process setup failure.","commonSituations":"Too many open files from leaked pipes across many blocks; resource limits in containers.","solutions":["Increase ulimit -n / container fd limits","Close or stop other running blocks to free descriptors","Restart the Wave process and retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to create stderr pipe\") {\n\t// raise fd limits or reduce running blocks, then retry start\n}","preventionTips":["Avoid running many subprocess-heavy blocks concurrently","Raise the per-process fd limit","Restart the app process if pipes leak over time"],"tags":["pipe","process","stderr"],"backgroundTag":"fd-exhaustion","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}