abpframework/abp · error · AbpException

Failed to validate storage zone '{containerName}': {ex.Messa

Error message

Failed to validate storage zone '{containerName}': {ex.Message}

What it means

Thrown by BunnyBlobProvider.ValidateContainerExistsAsync to wrap any exception raised by BunnyClientFactory.EnsureStorageZoneExistsAsync. It is an AbpException whose message embeds the inner exception's message and keeps the inner as InnerException. This is the outermost error a caller sees when the pre-save storage-zone validation (existence check / creation) fails.

Source

Thrown at framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/BunnyBlobProvider.cs:162

            : BlobNormalizeNamingService.NormalizeContainerName(args.Configuration, configuration.ContainerName!);
    }

    protected virtual async Task ValidateContainerExistsAsync(
        string containerName,
        BunnyBlobProviderConfiguration configuration
        )
    {
        try
        {
            await BunnyClientFactory.EnsureStorageZoneExistsAsync(
                configuration.AccessKey,
                containerName,
                configuration.Region ?? "de",
                configuration.CreateContainerIfNotExists);
        }
        catch (Exception ex)
        {
            throw new AbpException(
                $"Failed to validate storage zone '{containerName}': {ex.Message}",
                ex);
        }
    }
}

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Read InnerException.Message to identify the underlying cause (missing zone, creation failure, auth).
  2. If the zone legitimately does not exist, set CreateContainerIfNotExists=true or create it in the Bunny dashboard.
  3. Verify the AccessKey and region are correct and that the Bunny API is reachable.
  4. Retry transient network/API errors with backoff.

Example fix

// before
"Bunny": {
  "AccessKey": "...",
  "ContainerName": "my-zone"
}

// after (auto-create the zone)
"Bunny": {
  "AccessKey": "...",
  "ContainerName": "my-zone",
  "CreateContainerIfNotExists": true
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-validate that the zone exists and the key is set before saving:
if (configuration.AccessKey.IsNullOrWhiteSpace())
    throw new InvalidOperationException("Bunny AccessKey is not configured.");

Type guard

bool canValidateZone = !configuration.AccessKey.IsNullOrWhiteSpace() && !containerName.IsNullOrWhiteSpace();

Try / catch

try { await container.SaveAsync(blobName, stream); }
catch (AbpException ex) when (ex.Message.Contains("Failed to validate storage zone"))
{
    var cause = ex.InnerException?.Message ?? ex.Message;
    // cause guides: create zone, fix key, or retry
}

Prevention

When it happens

Trigger: The first step of BunnyBlobProvider.SaveAsync calls ValidateContainerExistsAsync, which calls EnsureStorageZoneExistsAsync. Any failure there (zone missing and createIfNotExists false, zone-creation HTTP failure, network error) is re-wrapped here before the upload proceeds.

Common situations: Storage zone does not exist and CreateContainerIfNotExists is false, invalid/expired AccessKey, Bunny API outage, insufficient permissions to create a zone, or network issues reaching api.bunny.net.

Related errors


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