wavetermdev/waveterm · error
getting file info: %w
Error message
getting file info: %w
What it means
fileInfoRun calls the FileInfoCommand RPC and wraps failures with 'getting file info:'. This fires when the RPC to fetch file metadata on the target host fails at the transport level (not for a simply-missing file, which is handled separately).
Source
Thrown at cmd/wsh/cmd/wshcmd-file.go:199
return fmt.Errorf("reading file: %w", err)
}
return nil
}
func fileInfoRun(cmd *cobra.Command, args []string) error {
path, err := fixRelativePaths(args[0])
if err != nil {
return err
}
fileData := wshrpc.FileData{
Info: &wshrpc.FileInfo{
Path: path}}
info, err := wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
err = convertNotFoundErr(err)
if err != nil {
return fmt.Errorf("getting file info: %w", err)
}
if info.NotFound {
return fmt.Errorf("%s: no such file", path)
}
WriteStdout("name:\t%s\n", info.Name)
if info.Mode != 0 {
WriteStdout("mode:\t%s\n", info.Mode.String())
}
WriteStdout("mtime:\t%s\n", time.Unix(info.ModTime/1000, 0).Format(time.DateTime))
if !info.IsDir {
WriteStdout("size:\t%d\n", info.Size)
}
if info.Meta != nil && len(*info.Meta) > 0 {
WriteStdout("metadata:\n")
for k, v := range *info.Meta {
WriteStdout("\t\t\t%s: %v\n", k, v)View on GitHub (pinned to a4447c1563)
Solutions
- Check connectivity to the target host and re-run the command.
- Retry on transient timeouts; increase fileTimeout if the network is slow.
- Ensure the remote wsh server version matches the client; update wsh remotely.
- Confirm you are connected (wsh conn status) before running file commands.
Defensive patterns
Strategy: retry
Validate before calling
// confirm connectivity before the RPC
if err := checkConnection(); err != nil {
return fmt.Errorf("not connected: %w", err)
}
info, err := wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout}) Try / catch
info, err := wshclient.FileInfoCommand(RpcClient, fileData, &wshrpc.RpcOpts{Timeout: fileTimeout})
if err != nil {
// transient? retry once with backoff before surfacing
return fmt.Errorf("getting file info: %w", err)
} Prevention
- Run `wsh conn status` before scripted file operations.
- Use a generous fileTimeout for slow networks.
- Keep remote wsh updated to match the client version.
When it happens
Trigger: `wsh file info <path>` where the RPC fails: no RPC connection, timeout (fileTimeout exceeded), remote wsh server not running, or connection dropped during the call.
Common situations: Querying info on a remote host that is offline or whose wsh server is stale, slow network exceeding the RPC timeout, running the command without a connected wave terminal.
Related errors
- unable to obtain client info: %w
- nil wshrpc passed to wshclient
- failed to list workspaces: %v
- failed to list blocks from all %d workspace(s)
- no route id available
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/c60aa9f0f5873f82.
Report an issue: GitHub.