{"record":{"id":"6df24e1781c6d999","repo":"abpframework/abp","slug":"storage-zone-containername-does-not-exist-set","errorCode":null,"errorMessage":"Storage zone '{containerName}' does not exist. Set createIfNotExists to true to create it automatically.","messagePattern":"Storage zone '(.+?)' does not exist\\. Set createIfNotExists to true to create it automatically\\.","errorType":"exception","errorClass":"AbpException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/DefaultBunnyClientFactory.cs","lineNumber":80,"sourceCode":"        // Decrypt the password before using it\n        var decryptedPassword = _stringEncryptionService.Decrypt(storageZoneInfo.Password);\n\n        return new BunnyCDNStorage(containerName, decryptedPassword, region);\n    }\n\n    public virtual async Task EnsureStorageZoneExistsAsync(\n        string accessKey,\n        string containerName,\n        string region = \"de\",\n        bool createIfNotExists = false)\n    {\n        var storageZone = await GetStorageZoneAsync(accessKey, containerName);\n\n        if (storageZone == null)\n        {\n            if (!createIfNotExists)\n            {\n                throw new AbpException(\n                    $\"Storage zone '{containerName}' does not exist. \" +\n                    \"Set createIfNotExists to true to create it automatically.\");\n            }\n\n            await CreateStorageZoneAsync(accessKey, containerName, region);\n\n            // Clear the cache to force a refresh of the storage zone info\n            var cacheKey = $\"{CacheKeyPrefix}{containerName}\";\n            await _cache.RemoveAsync(cacheKey);\n        }\n    }\n\n    protected virtual async Task<BunnyStorageZoneModel> CreateStorageZoneAsync(\n        string accessKey,\n        string containerName,\n        string region)\n    {\n        using (var client = _httpClientFactory.CreateClient(\"BunnyApiClient\"))","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/DefaultBunnyClientFactory.cs#L62-L98","documentation":"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.","triggerScenarios":"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.","commonSituations":"First deployment before the zone is provisioned, container name mismatch, or operating against a fresh Bunny account where the zone has not been created.","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."],"exampleFix":"// before\n\"Bunny\": {\n  \"AccessKey\": \"...\",\n  \"ContainerName\": \"my-zone\"\n}\n\n// after\n\"Bunny\": {\n  \"AccessKey\": \"...\",\n  \"ContainerName\": \"my-zone\",\n  \"CreateContainerIfNotExists\": true\n}","handlingStrategy":"validation","validationCode":"// Ensure the zone exists or allow auto-creation:\nconfiguration.CreateContainerIfNotExists = true;\nawait container.SaveAsync(blobName, stream);","typeGuard":"bool willAutoCreate = configuration.CreateContainerIfNotExists;","tryCatchPattern":"try { await container.SaveAsync(blobName, stream); }\ncatch (AbpException ex) when (ex.Message.Contains(\"does not exist\") && ex.Message.Contains(\"createIfNotExists\"))\n{ configuration.CreateContainerIfNotExists = true; /* retry */ }","preventionTips":["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."],"tags":["bunny","storage-zone","configuration","abp"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}