wavetermdev/waveterm · error

build output not found: %w

Error message

build output not found: %w

What it means

After a successful TsunamiBuildInternal call, the controller stats the expected output binary at cachePath. This wrapped error means the build reported success but the expected executable file does not exist at the output path (os.Stat failed), usually a build pipeline issue (MoveFileBack failed, wrong OutputFile location).

Source

Thrown at pkg/buildercontroller/buildercontroller.go:255

		SdkVersion:     sdkVersion,
		NodePath:       nodePath,
		GoPath:         goPath,
		OutputCapture:  outputCapture,
		MoveFileBack:   true,
	})

	for _, line := range outputCapture.GetLines() {
		bc.outputBuffer.AddLine(line)
	}

	if err != nil {
		bc.handleBuildError(fmt.Errorf("build failed: %w", err), resultCh)
		return
	}

	info, err := os.Stat(cachePath)
	if err != nil {
		bc.handleBuildError(fmt.Errorf("build output not found: %w", err), resultCh)
		return
	}

	if runtime.GOOS != "windows" && info.Mode()&0111 == 0 {
		bc.handleBuildError(fmt.Errorf("build output is not executable"), resultCh)
		return
	}

	process, err := bc.runBuilderApp(ctx, appId, cachePath, builderEnv)
	if err != nil {
		bc.handleBuildError(fmt.Errorf("failed to run app: %w", err), resultCh)
		return
	}

	bc.lock.Lock()
	bc.process = process
	bc.setStatus_nolock(BuilderStatus_Running, process.Port, 0, "")
	bc.lock.Unlock()

View on GitHub (pinned to a4447c1563)

Solutions

  1. Re-run the build with KeepTemp=true to inspect intermediate outputs
  2. Confirm OutputFile/cachePath matches where TsunamiBuildInternal actually writes
  3. Check for concurrent builds of the same app and serialize them
  4. Inspect disk space/permissions on the app cache directory

Example fix

// before
info, err := os.Stat(cachePath) // ENOENT after build
// after
if _, err := os.Stat(cachePath); os.IsNotExist(err) {
    // re-run TsunamiBuildInternal with KeepTemp=true to diagnose where output landed
}
Defensive patterns

Strategy: validation

Validate before calling

if _, err := os.Stat(cachePath); os.IsNotExist(err) {
    return fmt.Errorf("expected build output missing at %s", cachePath)
}

Try / catch

if err := runBuild(appId); err != nil {
    if strings.Contains(err.Error(), "build output not found") { /* rebuild with KeepTemp */ }
}

Prevention

When it happens

Trigger: TsunamiBuildInternal returns nil but the built binary is not present at cachePath — output file moved/renamed elsewhere, build silently skipped, or cachePath removed between build and stat.

Common situations: SDK/build pipeline version mismatch producing output at a different name/location; antivirus or cleanup process deleting the fresh binary; race with a concurrent build on the same appId.

Related errors


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