{"record":{"id":"65162efc1a27b337","repo":"abpframework/abp","slug":"remote-server-returns-statuscode-reasonphrase","errorCode":null,"errorMessage":"Remote server returns '{statusCode}-{reasonPhrase}'. {serverError} Authentication or license check failed while accessing {CliUrls.WwwAbpIo}. Please make sure you are logged in with `abp login <username>` and your ABP commercial license is active and covers the requested version. You can check your license at {CliUrls.WwwAbpIo}my-organizations","messagePattern":"Remote server returns '(.+?)-(.+?)'\\. (.+?) Authentication or license check failed while accessing (.+?)\\. Please make sure you are logged in with `abp login <username>` and your ABP commercial license is active and covers the requested version\\. You can check your license at (.+?)my-organizations","errorType":"exception","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs","lineNumber":302,"sourceCode":"    }\n\n    private async Task EnsureAbpIoSuccessfulResponseAsync(HttpResponseMessage responseMessage)\n    {\n        if (responseMessage is { StatusCode: HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden })\n        {\n            var message = $\"Remote server returns '{(int)responseMessage.StatusCode}-{responseMessage.ReasonPhrase}'. \";\n\n            var serverError = await RemoteServiceExceptionHandler.GetAbpRemoteServiceErrorAsync(responseMessage);\n            if (!string.IsNullOrWhiteSpace(serverError))\n            {\n                message += serverError + \" \";\n            }\n\n            message += $\"Authentication or license check failed while accessing {CliUrls.WwwAbpIo}. \" +\n                       \"Please make sure you are logged in with `abp login <username>` and your ABP commercial license is active and covers the requested version. \" +\n                       $\"You can check your license at {CliUrls.WwwAbpIo}my-organizations\";\n\n            throw new CliUsageException(message);\n        }\n\n        await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage);\n    }\n\n    private async Task<bool> IsVersionExists(string templateName, string version)\n    {\n        var url = $\"{CliUrls.WwwAbpIo}api/download/all-versions?includePreReleases=true\";\n\n        try\n        {\n            var client = _cliHttpClientFactory.CreateClient();\n\n            using (var response = await client.GetAsync(url,\n                _cliHttpClientFactory.GetCancellationToken(TimeSpan.FromMinutes(10))))\n            {\n                await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);\n                var result = await response.Content.ReadAsStringAsync();","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs#L284-L320","documentation":"Thrown by `AbpIoSourceCodeStore` when a download/template request to `www.abp.io` returns a non-success status, indicating authentication or license failure. It is a `CliUsageException` whose message combines the HTTP status code, the remote service error, and guidance to log in / verify the commercial license.","triggerScenarios":"Requesting a commercial template/module/version while not authenticated or with a license that does not cover it (typically 401/403 from the download endpoint).","commonSituations":"Forgot to run `abp login`; session expired; ABP commercial license expired or does not include the requested product/version; requesting a newer major than the license permits.","solutions":["Run `abp login <username>` with the account tied to an active commercial license and retry.","Open abp.io/my-organizations and confirm the license is active and covers the requested version/template.","If the license is fine, check for transient 5xx and retry, or verify network/proxy configuration."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure authenticated and licensed before a commercial template request.\nif (string.IsNullOrWhiteSpace(await authService.GetAccessTokenAsync()))\n    throw new InvalidOperationException(\"Not logged in. Run `abp login <username>`.\");","typeGuard":null,"tryCatchPattern":"try { await sourceCodeStore.GetAsync(name, type, version); }\ncatch (CliUsageException ex) when (ex.Message.Contains(\"Authentication or license check failed\"))\n{\n    logger.LogError(\"License/auth failed. Run `abp login` and verify your license at abp.io/my-organizations.\");\n    throw;\n}","preventionTips":["Run `abp login` before requesting commercial templates.","Track license expiry and covered versions in your org.","Use non-commercial templates when no license is available."],"tags":["cli","licensing","authentication","network","abp-io","templates"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}