abpframework/abp · error · Exception

ERROR: Remote server returns '{response.StatusCode}'

Error message

ERROR: Remote server returns '{response.StatusCode}'

What it means

Thrown by `AbpIoApiKeyService.GetApiKeyAsync` when the HTTP request to the ABP account API (`api/license/api-key`) returns a non-success status code. It is a raw `Exception` (not `CliUsageException`), surfacing the status code verbatim. This is used to fetch the developer API key tied to your ABP account/license.

Source

Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs:61

        if (invalidateCache)
        {
            _apiKeyResult = null;
        }

        if (_apiKeyResult != null)
        {
            return _apiKeyResult;
        }

        var url = $"{CliUrls.AccountAbpIo}api/license/api-key";
        var client = _cliHttpClientFactory.CreateClient();

        using (var response = await client.GetHttpResponseMessageWithRetryAsync(url, CancellationTokenProvider.Token, _logger))
        {
            if (!response.IsSuccessStatusCode)
            {
                throw new Exception($"ERROR: Remote server returns '{response.StatusCode}'");
            }

            await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);

            var responseContent = await response.Content.ReadAsStringAsync();
            return JsonSerializer.Deserialize<DeveloperApiKeyResult>(responseContent);
        }

    }
}

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Run `abp login <username>` with valid ABP account credentials, then retry.
  2. Check your license status at abp.io and confirm it is active and covers the version you are requesting.
  3. If the status is 5xx, wait and retry; check status.abp.io or community channels for an outage.
  4. Verify network/proxy settings are not intercepting the request (check `abp config` proxy values).
Defensive patterns

Strategy: retry

Validate before calling

// Pre-flight: confirm reachable and authenticated before requesting the API key.
var client = httpClientFactory.CreateClient();
using var probe = await client.GetAsync("https://account.abp.io/api/license/api-key", token);
if (!probe.IsSuccessStatusCode)
    Console.Error.WriteLine($"Cannot reach API key endpoint (HTTP {probe.StatusCode}). Run `abp login` first.");

Try / catch

for (int attempt = 0; attempt < 3; attempt++)
{
    try { return await apiKeyService.GetApiKeyAsync(); }
    catch (Exception ex) when (ex.Message.Contains("Remote server returns") && attempt < 2)
    {
        await Task.Delay(TimeSpan.FromSeconds(Math.Pow(2, attempt)));
    }
}
throw;

Prevention

When it happens

Trigger: Calling `abp login` or any flow that resolves a developer API key while the remote account service responds with an error status (401, 403, 5xx). The check happens before the body is parsed.

Common situations: Not logged in or expired session; ABP commercial license inactive/expired; transient outage of `account.abp.io`; corporate proxy/firewall returning a blocking status code; region blocking.

Related errors


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/2c946595e8dc478a. Report an issue: GitHub.