henrygd/beszel · error

no system data in response

Error message

no system data in response

What it means

unmarshalLegacyResponse returns this when a legacy (non-JSON-agent) response for common.GetData carries resp.SystemData == nil, so there is no CombinedData to copy into dest. The agent replied successfully but omitted the payload Beszel expects.

Source

Thrown at internal/hub/transport/transport.go:56

		if err := cbor.Unmarshal(resp.Data, dest); err != nil {
			return fmt.Errorf("failed to unmarshal generic response data: %w", err)
		}
		return nil
	}
	// Fall back to legacy typed fields for older agents/hubs.
	return unmarshalLegacyResponse(resp, action, dest)
}

// unmarshalLegacyResponse handles legacy responses that use typed fields.
func unmarshalLegacyResponse(resp common.AgentResponse, action common.WebSocketAction, dest any) error {
	switch action {
	case common.GetData:
		d, ok := dest.(*system.CombinedData)
		if !ok {
			return fmt.Errorf("unexpected dest type for GetData: %T", dest)
		}
		if resp.SystemData == nil {
			return errors.New("no system data in response")
		}
		*d = *resp.SystemData
		return nil
	case common.CheckFingerprint:
		d, ok := dest.(*common.FingerprintResponse)
		if !ok {
			return fmt.Errorf("unexpected dest type for CheckFingerprint: %T", dest)
		}
		if resp.Fingerprint == nil {
			return errors.New("no fingerprint in response")
		}
		*d = *resp.Fingerprint
		return nil
	case common.GetContainerLogs:
		d, ok := dest.(*string)
		if !ok {
			return fmt.Errorf("unexpected dest type for GetContainerLogs: %T", dest)
		}

View on GitHub (pinned to b38fb7dafa)

Solutions

  1. Update the agent to a version compatible with the hub
  2. Verify the transport/protocol in use matches the agent type (legacy vs JSON)
  3. Capture and inspect the raw response to confirm the agent really sent no data
  4. Retry the request once; if persistent, redeploy the agent
Defensive patterns

Strategy: validation

Validate before calling

// verify agent compatibility before sending GetData
if agentVersion.LessThan(minSupportedVersion) {
    return fmt.Errorf("agent %s outdated: upgrade before requesting data", host)
}

Try / catch

if err := UnmarshalResponse(resp, common.GetData, dest); err != nil {
    if strings.Contains(err.Error(), "no system data") {
        // trigger agent upgrade / full reconnect
    }
    return err
}

Prevention

When it happens

Trigger: UnmarshalResponse handling a GetData response from a legacy agent where the SystemData field was not populated (encoding issue or agent that sent no data).

Common situations: Old or custom agent builds that don't fill SystemData; protocol/version mismatch between hub and legacy agent; truncated/corrupted response decoding that yields a zero-value AgentResponse.

Related errors


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