{"record":{"id":"516cafe79add9603","repo":"henrygd/beszel","slug":"no-system-data-in-response","errorCode":null,"errorMessage":"no system data in response","messagePattern":"no system data in response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/hub/transport/transport.go","lineNumber":56,"sourceCode":"\t\tif err := cbor.Unmarshal(resp.Data, dest); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to unmarshal generic response data: %w\", err)\n\t\t}\n\t\treturn nil\n\t}\n\t// Fall back to legacy typed fields for older agents/hubs.\n\treturn unmarshalLegacyResponse(resp, action, dest)\n}\n\n// unmarshalLegacyResponse handles legacy responses that use typed fields.\nfunc unmarshalLegacyResponse(resp common.AgentResponse, action common.WebSocketAction, dest any) error {\n\tswitch action {\n\tcase common.GetData:\n\t\td, ok := dest.(*system.CombinedData)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected dest type for GetData: %T\", dest)\n\t\t}\n\t\tif resp.SystemData == nil {\n\t\t\treturn errors.New(\"no system data in response\")\n\t\t}\n\t\t*d = *resp.SystemData\n\t\treturn nil\n\tcase common.CheckFingerprint:\n\t\td, ok := dest.(*common.FingerprintResponse)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected dest type for CheckFingerprint: %T\", dest)\n\t\t}\n\t\tif resp.Fingerprint == nil {\n\t\t\treturn errors.New(\"no fingerprint in response\")\n\t\t}\n\t\t*d = *resp.Fingerprint\n\t\treturn nil\n\tcase common.GetContainerLogs:\n\t\td, ok := dest.(*string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected dest type for GetContainerLogs: %T\", dest)\n\t\t}","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/henrygd/beszel/blob/b38fb7dafa60812cc22e6a84ce313e94f1ce0a32/internal/hub/transport/transport.go#L38-L74","documentation":"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.","triggerScenarios":"UnmarshalResponse handling a GetData response from a legacy agent where the SystemData field was not populated (encoding issue or agent that sent no data).","commonSituations":"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.","solutions":["Update the agent to a version compatible with the hub","Verify the transport/protocol in use matches the agent type (legacy vs JSON)","Capture and inspect the raw response to confirm the agent really sent no data","Retry the request once; if persistent, redeploy the agent"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify agent compatibility before sending GetData\nif agentVersion.LessThan(minSupportedVersion) {\n    return fmt.Errorf(\"agent %s outdated: upgrade before requesting data\", host)\n}","typeGuard":null,"tryCatchPattern":"if err := UnmarshalResponse(resp, common.GetData, dest); err != nil {\n    if strings.Contains(err.Error(), \"no system data\") {\n        // trigger agent upgrade / full reconnect\n    }\n    return err\n}","preventionTips":["Keep agents updated with the hub","Reconnect fully after protocol/version changes","Alert when a system repeatedly returns empty data"],"tags":["go","protocol","deserialization","legacy-agent"],"backgroundTag":"missing-payload-in-response","analyzedSha":"b38fb7dafa60812cc22e6a84ce313e94f1ce0a32","analyzedAt":"2026-08-31T15:10:10.149Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}