wavetermdev/waveterm · error

failed to create stderr pipe: %w

Error message

failed to create stderr pipe: %w

What it means

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.

Source

Thrown at pkg/blockcontroller/tsunamicontroller.go:318

		cmd.Env = append(cmd.Env, "TSUNAMI_CORS="+tsunamiutil.DevModeCorsOrigins)
	}

	// Add TsunamiEnv variables if configured
	tsunamiEnv := blockMeta.GetMap(waveobj.MetaKey_TsunamiEnv)
	for key, value := range tsunamiEnv {
		if strValue, ok := value.(string); ok {
			cmd.Env = append(cmd.Env, key+"="+strValue)
		}
	}

	stdoutPipe, err := cmd.StdoutPipe()
	if err != nil {
		return nil, fmt.Errorf("failed to create stdout pipe: %w", err)
	}

	stderrPipe, err := cmd.StderrPipe()
	if err != nil {
		return nil, fmt.Errorf("failed to create stderr pipe: %w", err)
	}

	stdinPipe, err := cmd.StdinPipe()
	if err != nil {
		return nil, fmt.Errorf("failed to create stdin pipe: %w", err)
	}

	appName := build.GetAppName(appPath)

	lineBuffer := utilds.MakeMultiReaderLineBuffer(1000)
	portChan := make(chan int, 1)
	portFound := false

	lineBuffer.SetLineCallback(func(line string) {
		log.Printf("[tsunami:%s] %s\n", appName, line)

		if !portFound {
			if port := build.ParseTsunamiPort(line); port > 0 {

View on GitHub (pinned to a4447c1563)

Solutions

  1. Increase ulimit -n / container fd limits
  2. Close or stop other running blocks to free descriptors
  3. Restart the Wave process and retry
Defensive patterns

Strategy: retry

Try / catch

if err != nil && strings.Contains(err.Error(), "failed to create stderr pipe") {
	// raise fd limits or reduce running blocks, then retry start
}

Prevention

When it happens

Trigger: runTsunamiAppBinary calls cmd.StderrPipe() and it errors — practically only fd exhaustion or process setup failure.

Common situations: Too many open files from leaked pipes across many blocks; resource limits in containers.

Related errors


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