{"record":{"id":"91889816effcef8a","repo":"henrygd/beszel","slug":"unsupported-action-d","errorCode":null,"errorMessage":"unsupported action: %d","messagePattern":"unsupported action: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/hub/transport/transport.go","lineNumber":119,"sourceCode":"\t\t\t}\n\t\t\td.Data = resp.SmartData\n\t\t\td.Complete = resp.SmartComplete\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unexpected dest type for GetSmartData: %T\", dest)\n\t\t}\n\tcase common.GetSystemdInfo:\n\t\td, ok := dest.(*systemd.ServiceDetails)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected dest type for GetSystemdInfo: %T\", dest)\n\t\t}\n\t\tif resp.ServiceInfo == nil {\n\t\t\treturn errors.New(\"no systemd info in response\")\n\t\t}\n\t\t*d = resp.ServiceInfo\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unsupported action: %d\", action)\n}\n","sourceCodeStart":101,"sourceCodeEnd":121,"githubUrl":"https://github.com/henrygd/beszel/blob/b38fb7dafa60812cc22e6a84ce313e94f1ce0a32/internal/hub/transport/transport.go#L101-L121","documentation":"unmarshalLegacyResponse only knows how to decode legacy typed fields for GetData, CheckFingerprint, GetContainerLogs, GetContainerInfo, GetSmartData, and GetSystemdInfo. Any other action code reaching the legacy path is rejected with this error.","triggerScenarios":"Calling Transport.Request/UnmarshalResponse with an action value not in the legacy switch (e.g. a newer action added after 0.18.0) while the response has an empty Data field, or passing a zero/invalid action value.","commonSituations":"Requesting a newer action (introduced post-0.18) against a hub/agent pairing where the generic Data path is not taken; enum drift between hub and agent versions; passing an uninitialized action constant.","solutions":["Verify the action is one of the supported common.WebSocketAction values","Upgrade hub and agent together to 0.19+ so responses use the generic CBOR Data path, bypassing the legacy switch","Check for version skew: an old agent (0.18.0) returning legacy responses cannot serve new actions"],"exampleFix":"// before\nvar res systemd.ServiceDetails\nerr := t.Request(ctx, common.GetLogsPlus, req, &res) // action unsupported in legacy path\n// after\nvar res systemd.ServiceDetails\nerr := t.Request(ctx, common.GetSystemdInfo, req, &res)","handlingStrategy":"validation","validationCode":"var supported = map[common.WebSocketAction]bool{\n    common.GetData: true, common.CheckFingerprint: true, common.GetContainerLogs: true,\n    common.GetContainerInfo: true, common.GetSmartData: true, common.GetSystemdInfo: true,\n}\nif !supported[action] {\n    return fmt.Errorf(\"action %d not supported for legacy responses\", action)\n}","typeGuard":null,"tryCatchPattern":"if err := t.Request(ctx, action, req, dest); err != nil {\n    if strings.Contains(err.Error(), \"unsupported action\") { /* upgrade agent or change action */ }\n    return err\n}","preventionTips":["Only send legacy-supported actions to 0.18.0 agents","Keep hub and agent versions aligned","Validate the action constant against supported values before calling Request"],"tags":["unsupported-action","legacy-response","version-skew"],"backgroundTag":"unsupported-action","analyzedSha":"b38fb7dafa60812cc22e6a84ce313e94f1ce0a32","analyzedAt":"2026-08-31T15:10:10.149Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}