abpframework/abp · error · AbpException

Storage zone '{containerName}' not found

Error message

Storage zone '{containerName}' not found

What it means

Thrown inside DefaultBunnyClientFactory.CreateAsync's cache factory when GetStorageZoneAsync returns null (no matching, non-deleted zone found for the container name). It is raised within the GetOrAddAsync value-factory, so it propagates before any cached value can be stored. The message names the containerName that could not be resolved to a storage zone.

Source

Thrown at framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/DefaultBunnyClientFactory.cs:44

        IHttpClientFactory httpClient,
        IDistributedCache<BunnyStorageZoneModel> cache,
        IStringEncryptionService stringEncryptionService)
    {
        _cache = cache;
        _httpClientFactory = httpClient;
        _stringEncryptionService = stringEncryptionService;
    }

    public virtual async Task<BunnyCDNStorage> CreateAsync(string accessKey, string containerName, string region = "de")
    {
        var cacheKey = $"{CacheKeyPrefix}{containerName}";
        var storageZoneInfo = await _cache.GetOrAddAsync(
            cacheKey,
            async () => {
                var result = await GetStorageZoneAsync(accessKey, containerName);
                if (result == null)
                {
                    throw new AbpException($"Storage zone '{containerName}' not found");
                }

                // Encrypt the sensitive password before caching
                result.Password = _stringEncryptionService.Encrypt(result.Password!)!;
                return result;
            },
            () => new DistributedCacheEntryOptions
            {
                AbsoluteExpiration = DateTimeOffset.Now.Add(CacheDuration)
            }
        );

        if (storageZoneInfo == null)
        {
            throw new AbpException($"Could not retrieve storage zone information for container '{containerName}'");
        }

        // Decrypt the password before using it

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Confirm the container name exactly matches an existing storage zone in the Bunny dashboard.
  2. Ensure the AccessKey corresponds to the account that owns the zone.
  3. Create the zone in Bunny (or enable CreateContainerIfNotExists) before operating.
  4. Check the zone is not marked Deleted.

Example fix

// before
"Bunny": { "ContainerName": "media-zone" }

// after (name matches an existing Bunny storage zone)
"Bunny": { "ContainerName": "my-media-zone" }
Defensive patterns

Strategy: validation

Validate before calling

// Before first operation, confirm the zone name resolves in your Bunny account:
// (call EnsureStorageZoneExistsAsync with createIfNotExists as desired)
if (containerName.IsNullOrWhiteSpace())
    throw new InvalidOperationException("Bunny ContainerName is not configured.");

Type guard

bool zoneLikelyExists = !containerName.IsNullOrWhiteSpace() && !accessKey.IsNullOrWhiteSpace();

Try / catch

try { await container.SaveAsync(blobName, stream); }
catch (AbpException ex) when (ex.Message.Contains("Storage zone") && ex.Message.Contains("not found"))
{ /* create the zone in Bunny or fix the container name */ }

Prevention

When it happens

Trigger: Creating a BunnyCDNStorage client (CreateAsync) for a containerName that has no corresponding storage zone in the Bunny account, or whose only matching zone is marked Deleted. Triggered on the first blob operation needing a client.

Common situations: Container name typo, zone not yet created in the Bunny dashboard, zone was deleted, or the AccessKey belongs to a different account that does not own the zone.

Related errors


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