wavetermdev/waveterm · error

getting variables: %w

Error message

getting variables: %w

What it means

getAllVariables wraps failures of the GetAllVarsCommand RPC (2s timeout) with this message (cmd/wshcmd-getvar.go:118). It is raised when the bulk variable dump RPC cannot be completed — transport failure, timeout, or server-side error — and is only reachable via `wsh getvar --all`.

Source

Thrown at cmd/wsh/cmd/wshcmd-getvar.go:118

	}

	WriteStdout("%s", resp.Val)
	if shouldPrintNewline() {
		WriteStdout("\n")
	}

	return nil
}

func getAllVariables(zoneId string) error {
	commandData := wshrpc.CommandVarData{
		ZoneId:   zoneId,
		FileName: getVarFileName,
	}

	vars, err := wshclient.GetAllVarsCommand(RpcClient, commandData, &wshrpc.RpcOpts{Timeout: 2000})
	if err != nil {
		return fmt.Errorf("getting variables: %w", err)
	}

	terminator := "\n"
	if getVarNullTerminate {
		terminator = "\x00"
	}

	for _, v := range vars {
		WriteStdout("%s=%s%s", v.Key, v.Val, terminator)
	}

	return nil
}

View on GitHub (pinned to a4447c1563)

Solutions

  1. Confirm connectivity (Wave app running, connection up) and retry `wsh getvar --all`
  2. Re-resolve the target block — the OID may be stale if the block was closed
  3. If the environment is slow, note the fixed 2s timeout; ensure the machine is not overloaded

Example fix

// before
wsh getvar --all --block <closed-blockid>  # rpc fails
// after
wsh ls   # find a live block id
wsh getvar --all --block <live-blockid>
Defensive patterns

Strategy: try-catch

Validate before calling

wsh conn show || { echo 'no connection'; exit 1; }

Try / catch

if ! wsh getvar --all >vars.txt 2>err.txt; then
  grep -qi 'timeout' err.txt && echo 'RPC timed out; retry when app is less busy'
  exit 1
fi

Prevention

When it happens

Trigger: Running `wsh getvar --all` when the RPC to the resolved zone (block OID or client) fails or exceeds the 2000ms timeout.

Common situations: Remote/ssh session with a dropped Wave connection; targeting a stale block id; app busy so the 2s timeout expires; varfile name issues surfaced server-side.

Related errors


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