{"record":{"id":"71eaeb8949a281f1","repo":"wavetermdev/waveterm","slug":"failed-to-run-tsunami-app-w","errorCode":null,"errorMessage":"failed to run tsunami app: %w","messagePattern":"failed to run tsunami app: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/blockcontroller/tsunamicontroller.go","lineNumber":209,"sourceCode":"\t\t\treturn fmt.Errorf(\"failed to build tsunami app: %w\", err)\n\t\t}\n\t}\n\n\tinfo, err := os.Stat(cachePath)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"app cache does not exist: %s\", cachePath)\n\t\t}\n\t\treturn fmt.Errorf(\"failed to stat app cache: %w\", err)\n\t}\n\n\tif runtime.GOOS != \"windows\" && info.Mode()&0111 == 0 {\n\t\treturn fmt.Errorf(\"app cache is not executable: %s\", cachePath)\n\t}\n\n\ttsunamiProc, err := runTsunamiAppBinary(ctx, cachePath, appPath, blockMeta)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to run tsunami app: %w\", err)\n\t}\n\n\tc.tsunamiProc = tsunamiProc\n\tc.WithStatusLock(func() {\n\t\tc.status = Status_Running\n\t\tc.port = tsunamiProc.Port\n\t})\n\tgo c.sendStatusUpdate()\n\n\t// Monitor process completion\n\tgo func() {\n\t\t<-tsunamiProc.WaitCh\n\t\tc.runLock.Lock()\n\t\tif c.tsunamiProc == tsunamiProc {\n\t\t\tc.tsunamiProc = nil\n\t\t\tc.WithStatusLock(func() {\n\t\t\t\tc.status = Status_Done\n\t\t\t\tc.port = 0","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/blockcontroller/tsunamicontroller.go#L191-L227","documentation":"Wave failed to launch a tsunami app binary after it was downloaded and verified executable. runTsunamiAppBinary returned an error while creating pipes or starting the process, and Start wraps it with this message. It is a wrapper error — the underlying cause is in the wrapped %w chain.","triggerScenarios":"Starting a tsunami block when cmd.Start() fails (binary invalid, missing shared libs, wrong arch), or stdout/stderr/stdin pipe creation fails inside runTsunamiAppBinary.","commonSituations":"Corrupted or incompatible cached binary (e.g. macOS binary on Linux, x86 on ARM), disk or fd exhaustion, app cache partially downloaded.","solutions":["Inspect the wrapped %w cause for the actual failure","Delete the app cache directory and re-download the app","Verify the binary matches the current OS/arch and is a valid ELF/Mach-O executable","Check ulimit/file-descriptor limits and free disk space"],"exampleFix":"// before\ntsunamiProc, err := runTsunamiAppBinary(ctx, cachePath, appPath, blockMeta)\n// after\nif _, statErr := os.Stat(cachePath); statErr != nil {\n\t// force re-download of the app cache before running\n}","handlingStrategy":"try-catch","validationCode":"info, err := os.Stat(cachePath)\nif err != nil || info.Mode()&0111 == 0 { /* re-download app cache */ }","typeGuard":null,"tryCatchPattern":"proc, err := ctl.Start(ctx)\nif err != nil && strings.Contains(err.Error(), \"failed to run tsunami app\") {\n\t// inspect %w cause, purge cache, retry once\n}","preventionTips":["Purge and re-download the app cache after platform or version changes","Verify binary executability and arch before starting","Monitor fd/disk resources on long-running sessions"],"tags":["process","subprocess","tsunami"],"backgroundTag":"process-start-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}