abpframework/abp · error · AbpException
Storage zone '{containerName}' does not exist. Set createIfN
Error message
Storage zone '{containerName}' does not exist. Set createIfNotExists to true to create it automatically. What it means
Thrown by DefaultBunnyClientFactory.EnsureStorageZoneExistsAsync when GetStorageZoneAsync returns null (zone not found) and createIfNotExists is false. It directs the caller to set createIfNotExists to true so the zone is created automatically. This method is invoked by BunnyBlobProvider.ValidateContainerExistsAsync at the start of SaveAsync.
Source
Thrown at framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/DefaultBunnyClientFactory.cs:80
// Decrypt the password before using it
var decryptedPassword = _stringEncryptionService.Decrypt(storageZoneInfo.Password);
return new BunnyCDNStorage(containerName, decryptedPassword, region);
}
public virtual async Task EnsureStorageZoneExistsAsync(
string accessKey,
string containerName,
string region = "de",
bool createIfNotExists = false)
{
var storageZone = await GetStorageZoneAsync(accessKey, containerName);
if (storageZone == null)
{
if (!createIfNotExists)
{
throw new AbpException(
$"Storage zone '{containerName}' does not exist. " +
"Set createIfNotExists to true to create it automatically.");
}
await CreateStorageZoneAsync(accessKey, containerName, region);
// Clear the cache to force a refresh of the storage zone info
var cacheKey = $"{CacheKeyPrefix}{containerName}";
await _cache.RemoveAsync(cacheKey);
}
}
protected virtual async Task<BunnyStorageZoneModel> CreateStorageZoneAsync(
string accessKey,
string containerName,
string region)
{
using (var client = _httpClientFactory.CreateClient("BunnyApiClient"))View on GitHub (pinned to 7ed43b1931)
Solutions
- Set CreateContainerIfNotExists=true in the Bunny configuration so the zone is created on demand.
- Create the storage zone manually in the Bunny dashboard before running.
- Verify the container name matches the intended zone name.
Example fix
// before
"Bunny": {
"AccessKey": "...",
"ContainerName": "my-zone"
}
// after
"Bunny": {
"AccessKey": "...",
"ContainerName": "my-zone",
"CreateContainerIfNotExists": true
} Defensive patterns
Strategy: validation
Validate before calling
// Ensure the zone exists or allow auto-creation: configuration.CreateContainerIfNotExists = true; await container.SaveAsync(blobName, stream);
Type guard
bool willAutoCreate = configuration.CreateContainerIfNotExists;
Try / catch
try { await container.SaveAsync(blobName, stream); }
catch (AbpException ex) when (ex.Message.Contains("does not exist") && ex.Message.Contains("createIfNotExists"))
{ configuration.CreateContainerIfNotExists = true; /* retry */ } Prevention
- Set CreateContainerIfNotExists=true when the zone may not pre-exist.
- Pre-create zones in the Bunny dashboard for production stability.
- Verify the container name matches an intended zone.
When it happens
Trigger: Saving a blob through the Bunny provider when the storage zone does not exist and BunnyBlobProviderConfiguration.CreateContainerIfNotExists is false (the default). EnsureStorageZoneExistsAsync lists zones; finding none matching, it throws rather than creating.
Common situations: First deployment before the zone is provisioned, container name mismatch, or operating against a fresh Bunny account where the zone has not been created.
Related errors
- Failed to validate storage zone '{containerName}': {ex.Messa
- Storage zone '{containerName}' not found
- Could not retrieve storage zone information for container '{
- Container name contains invalid characters: {containerName}.
- Container name must be between {MinLength} and {MaxLength} c
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/6df24e1781c6d999.
Report an issue: GitHub.