{"record":{"id":"aa837d536557f5dd","repo":"abpframework/abp","slug":"remote-server-returns-statuscode-reasonphrase-aa837d","errorCode":null,"errorMessage":"Remote server returns '{statusCode}-{reasonPhrase}'. {remoteServiceErrorMessage}","messagePattern":"Remote server returns '(.+?)-(.+?)'\\. (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/RemoteServiceExceptionHandler.cs","lineNumber":45,"sourceCode":"        {\n            return;\n        }\n\n        if (responseMessage.IsSuccessStatusCode)\n        {\n            return;\n        }\n\n        var exceptionMessage = \"Remote server returns '\" + (int)responseMessage.StatusCode + \"-\" +\n                               responseMessage.ReasonPhrase + \"'. \";\n\n        var remoteServiceErrorMessage = await GetAbpRemoteServiceErrorAsync(responseMessage);\n        if (remoteServiceErrorMessage != null)\n        {\n            exceptionMessage += remoteServiceErrorMessage;\n        }\n\n        throw new Exception(exceptionMessage);\n    }\n\n    public async Task<string> GetAbpRemoteServiceErrorAsync(HttpResponseMessage responseMessage)\n    {\n        RemoteServiceErrorResponse errorResult;\n        try\n        {\n            errorResult = _jsonSerializer.Deserialize<RemoteServiceErrorResponse>(\n                await responseMessage.Content.ReadAsStringAsync()\n            );\n        }\n        catch (Exception ex) when (IsJsonException(ex))\n        {\n            return null;\n        }\n\n        if (errorResult?.Error == null)\n        {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/RemoteServiceExceptionHandler.cs#L27-L63","documentation":"Thrown by `RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync` when an HTTP response from abp.io is not successful and the status code is not in the handled set. The message combines the numeric status code, reason phrase, and any error message parsed from the remote `RemoteServiceErrorResponse` body. It is a raw `Exception`.","triggerScenarios":"Any CLI HTTP call to abp.io that returns an unhandled non-success status (e.g. 500, 502, 404) after specific status codes have been special-cased elsewhere.","commonSituations":"abp.io server error or outage; endpoint moved/removed (404); malformed remote response; transient gateway errors.","solutions":["Retry after a short wait for transient 5xx/502/503 errors.","Check status.abp.io / community channels for an ongoing outage.","For 404, ensure the CLI is up to date (`dotnet tool update -g Volo.Abp.Cli`) so it calls the correct endpoints.","Inspect the remote service error in the message for endpoint-specific guidance."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Optional pre-flight to surface outages early.\nusing var probe = await client.GetAsync(url, token);\nif ((int)probe.StatusCode >= 500)\n    Console.Error.WriteLine($\"Remote returned {probe.StatusCode}; consider retrying later.\");","typeGuard":null,"tryCatchPattern":"for (int attempt = 0; attempt < 3; attempt++)\n{\n    try { await remoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response); break; }\n    catch (Exception ex) when (ex.Message.StartsWith(\"Remote server returns\") && attempt < 2)\n    {\n        await Task.Delay(TimeSpan.FromSeconds(Math.Pow(2, attempt)));\n    }\n}","preventionTips":["Treat 5xx as transient and retry with backoff.","Keep the CLI updated to call the current endpoints (avoid 404).","Log the remote service error message for faster diagnosis."],"tags":["cli","network","abp-io","http","error-handling"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}