wavetermdev/waveterm · error

tsunami process died before emitting listening message

Error message

tsunami process died before emitting listening message

What it means

The tsunami app process exited without ever printing its 'listening' message (from which the HTTP port is parsed). The controller detects this via WaitCh firing before portChan receives a port, so the block fails to start.

Source

Thrown at pkg/blockcontroller/tsunamicontroller.go:391

			}
		}

		close(waitCh)
	}()

	// Start reading both stdout and stderr
	go lineBuffer.ReadAll(stdoutPipe)
	go lineBuffer.ReadAll(stderrPipe)

	// Wait for either port detection, process death, or context timeout
	errChan := make(chan error, 1)
	go func() {
		<-tsunamiProc.WaitCh
		select {
		case <-portChan:
			// Port already found, nothing to do
		default:
			errChan <- fmt.Errorf("tsunami process died before emitting listening message")
		}
	}()

	select {
	case port := <-portChan:
		tsunamiProc.Port = port
		return tsunamiProc, nil
	case err := <-errChan:
		cmd.Process.Kill()
		return nil, err
	case <-ctx.Done():
		cmd.Process.Kill()
		return nil, fmt.Errorf("timeout waiting for tsunami port: %w", ctx.Err())
	}
}

func MakeTsunamiController(tabId string, blockId string, connName string) Controller {
	log.Printf("make tsunami controller: %s %s\n", tabId, blockId)

View on GitHub (pinned to a4447c1563)

Solutions

  1. Check the captured stderr/stdout buffer for the app's crash message
  2. Run the cached binary manually to see the startup error
  3. Re-download the app to rule out a corrupted build
  4. Verify any required runtimes/env vars for the app are present
Defensive patterns

Strategy: fallback

Validate before calling

// smoke-test the binary: run with a short timeout and confirm it emits output instead of exiting immediately

Try / catch

select {
case port := <-portChan:
	// ready
case err := <-errChan:
	// read captured stderr/stdout buffer for the crash reason
}

Prevention

When it happens

Trigger: App crashes on startup, exits immediately due to bad config/missing deps, or prints an error and dies before binding a port.

Common situations: App requires a runtime (Node/Python) that is missing; app's own startup error; incompatibility between app and host platform.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/877665a014cb49ef. Report an issue: GitHub.