{"record":{"id":"ed57da78a7964056","repo":"JosefNemec/Playnite","slug":"result-error-ed57da","errorCode":null,"errorMessage":"result.Error","messagePattern":"result\\.Error","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"source/Playnite/Services/ServicesClient.cs","lineNumber":51,"sourceCode":"\r\n        public List<string> GetPatrons()\r\n        {\r\n            return ExecuteGetRequest<List<string>>(\"/patreon/patrons\");\r\n        }\r\n\r\n        public Guid UploadDiagPackage(string diagPath)\r\n        {\r\n            using (var fs = new FileStream(diagPath, FileMode.Open))\r\n            {\r\n                using (var content = new StreamContent(fs))\r\n                {\r\n                    var response = HttpClient.PostAsync(Endpoint + \"/playnite/diag\", content).GetAwaiter().GetResult();\r\n                    var strResult = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();\r\n                    var result = JsonConvert.DeserializeObject<ServicesResponse<Guid>>(strResult);\r\n                    if (!string.IsNullOrEmpty(result.Error))\r\n                    {\r\n                        logger.Error(\"Service request error by proxy: \" + result.Error);\r\n                        throw new Exception(result.Error);\r\n                    }\r\n\r\n                    return result.Data;\r\n                }\r\n            }\r\n        }\r\n\r\n        public List<AddonManifest> GetAllAddons(AddonType type, string searchTerm)\r\n        {\r\n            return ExecuteGetRequest<List<AddonManifest>>($\"/addons?type={type}&searchTerm={searchTerm}\".UrlEncode());\r\n        }\r\n\r\n        public AddonManifest GetAddon(string addonId)\r\n        {\r\n            return ExecuteGetRequest<List<AddonManifest>>($\"/addons?addonId={addonId}\".UrlEncode()).FirstOrDefault();\r\n        }\r\n\r\n        public AddonInstallerManifest GetAddonInstaller(string addonId)\r","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/JosefNemec/Playnite/blob/5911f4e964e628aa7a69c2030ab35101afa63067/source/Playnite/Services/ServicesClient.cs#L33-L69","documentation":"Thrown by ServicesClient.UploadDiagPackage when the POST to /playnite/diag returns a ServicesResponse<Guid> whose Error field is non-empty. The diagnostic-upload handler on the services proxy reported an error (size limit, server fault, storage failure), and the client re-throws the server's message.","triggerScenarios":"UploadDiagPackage(diagPath) POSTs the file stream to Endpoint+'/playnite/diag'; the response body deserializes with a non-empty Error at line 48. The server accepted the connection but failed to ingest the package.","commonSituations":"Diag package exceeds the server's max body size. Backend storage (blob/db) temporarily unavailable. ServicesUrl points to a stale endpoint that returns an error envelope. Auth/anti-abuse layer on the proxy rejected the upload.","solutions":["Read the captured Error text from the log to determine whether it's size, storage, or auth related.","If the diag file is large, retry once after a backend restart or contact support; the server-side cap may need raising.","Verify Endpoint (ServicesUrl) resolves to the current service and the Playnite-Version header is set.","On persistent failure, fall back to saving the diag locally and sharing it manually."],"exampleFix":"// before\nvar id = client.UploadDiagPackage(diagPath);\n\n// after\ntry { return client.UploadDiagPackage(diagPath); }\ncatch (Exception ex)\n{\n    logger.Error(ex, \"Diag upload failed; saving locally\");\n    File.Copy(diagPath, Path.Combine(localDir, Path.GetFileName(diagPath)));\n    throw;\n}","handlingStrategy":"try-catch","validationCode":"if (!File.Exists(diagPath)) throw new FileNotFoundException(diagPath);\nvar size = new FileInfo(diagPath).Length;\nif (size > MaxDiagBytes) throw new InvalidOperationException($\"Diag package too large: {size}\");","typeGuard":"static bool CanUploadDiag(string path) => File.Exists(path) && new FileInfo(path).Length <= MaxDiagBytes;","tryCatchPattern":"try { return client.UploadDiagPackage(diagPath); }\ncatch (Exception ex)\n{\n    logger.Error(ex, \"Diag upload failed; keep local copy\");\n    File.Copy(diagPath, Path.Combine(localFallbackDir, Path.GetFileName(diagPath)), overwrite: true);\n    throw;\n}","preventionTips":["Check diag file size against the server cap before upload.","Keep a local copy on failure so diagnostics aren't lost.","Verify the ServicesUrl endpoint is current."],"tags":["network","services","http","upload","diagnostics","playnite"],"backgroundTag":null,"analyzedSha":"5911f4e964e628aa7a69c2030ab35101afa63067","analyzedAt":"2026-08-13T17:38:25.713Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}