henrygd/beszel · error

${resp.Error}

Error message

${resp.Error}

What it means

The SSH agent executed the request and returned an AgentResponse whose Error field is non-empty; Request forwards it verbatim (errors.New(resp.Error)). The message text is whatever the agent reported, so it varies per failure.

Source

Thrown at internal/hub/transport/ssh.go:112

	if err := session.Shell(); err != nil {
		return err
	}

	// Send request
	hubReq := common.HubRequest[any]{Action: action, Data: req}
	if err := cbor.NewEncoder(stdin).Encode(hubReq); err != nil {
		return fmt.Errorf("failed to encode request: %w", err)
	}
	stdin.Close()

	// Read response
	var resp common.AgentResponse
	if err := cbor.NewDecoder(stdout).Decode(&resp); err != nil {
		return fmt.Errorf("failed to decode response: %w", err)
	}

	if resp.Error != "" {
		return errors.New(resp.Error)
	}

	if err := session.Wait(); err != nil {
		return err
	}

	return UnmarshalResponse(resp, action, dest)
}

// IsConnected returns true if the SSH connection is active.
func (t *SSHTransport) IsConnected() bool {
	return t.client != nil
}

// Close terminates the SSH connection.
func (t *SSHTransport) Close() {
	if t.client != nil {
		t.client.Close()

View on GitHub (pinned to b38fb7dafa)

Solutions

  1. Read resp.Error text in the returned error to see the agent's actual complaint
  2. Update the agent on the remote host to match the hub version
  3. SSH into the host and run the beszel agent manually to reproduce the error
  4. Check the agent's logs on the remote machine
  5. Retry the request; transient collection errors may resolve
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check: ensure agent is reachable and version-compatible
version, err := client.Request(common.GetVersion, new(string))
if err != nil { /* agent reporting errors or incompatible */ }

Try / catch

data, err := client.RequestWithRetry(common.GetData, dest)
if err != nil {
    log.Printf("agent error from %s: %v", host, err) // message is the agent's own text
    return err
}

Prevention

When it happens

Trigger: Any SSH Request (via RequestWithRetry) where the remote agent processes the command but reports an error in resp.Error — e.g. agent-side command failure, unreadable data, unsupported request.

Common situations: Agent and hub version mismatch causing unsupported requests; the agent failing to collect stats (permissions, missing /proc entries); corrupted or stale agent installation on the host.

Related errors


AI-assisted analysis of henrygd/beszel@b38fb7dafa (2026-08-31). Data as JSON: /api/errors/e5720f793347efaa. Report an issue: GitHub.