{"record":{"id":"49294552311ee5a5","repo":"abpframework/abp","slug":"storage-zone-containername-not-found","errorCode":null,"errorMessage":"Storage zone '{containerName}' not found","messagePattern":"Storage zone '(.+?)' not found","errorType":"exception","errorClass":"AbpException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/DefaultBunnyClientFactory.cs","lineNumber":44,"sourceCode":"        IHttpClientFactory httpClient,\n        IDistributedCache<BunnyStorageZoneModel> cache,\n        IStringEncryptionService stringEncryptionService)\n    {\n        _cache = cache;\n        _httpClientFactory = httpClient;\n        _stringEncryptionService = stringEncryptionService;\n    }\n\n    public virtual async Task<BunnyCDNStorage> CreateAsync(string accessKey, string containerName, string region = \"de\")\n    {\n        var cacheKey = $\"{CacheKeyPrefix}{containerName}\";\n        var storageZoneInfo = await _cache.GetOrAddAsync(\n            cacheKey,\n            async () => {\n                var result = await GetStorageZoneAsync(accessKey, containerName);\n                if (result == null)\n                {\n                    throw new AbpException($\"Storage zone '{containerName}' not found\");\n                }\n\n                // Encrypt the sensitive password before caching\n                result.Password = _stringEncryptionService.Encrypt(result.Password!)!;\n                return result;\n            },\n            () => new DistributedCacheEntryOptions\n            {\n                AbsoluteExpiration = DateTimeOffset.Now.Add(CacheDuration)\n            }\n        );\n\n        if (storageZoneInfo == null)\n        {\n            throw new AbpException($\"Could not retrieve storage zone information for container '{containerName}'\");\n        }\n\n        // Decrypt the password before using it","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/DefaultBunnyClientFactory.cs#L26-L62","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm the container name exactly matches an existing storage zone in the Bunny dashboard.","Ensure the AccessKey corresponds to the account that owns the zone.","Create the zone in Bunny (or enable CreateContainerIfNotExists) before operating.","Check the zone is not marked Deleted."],"exampleFix":"// before\n\"Bunny\": { \"ContainerName\": \"media-zone\" }\n\n// after (name matches an existing Bunny storage zone)\n\"Bunny\": { \"ContainerName\": \"my-media-zone\" }","handlingStrategy":"validation","validationCode":"// Before first operation, confirm the zone name resolves in your Bunny account:\n// (call EnsureStorageZoneExistsAsync with createIfNotExists as desired)\nif (containerName.IsNullOrWhiteSpace())\n    throw new InvalidOperationException(\"Bunny ContainerName is not configured.\");","typeGuard":"bool zoneLikelyExists = !containerName.IsNullOrWhiteSpace() && !accessKey.IsNullOrWhiteSpace();","tryCatchPattern":"try { await container.SaveAsync(blobName, stream); }\ncatch (AbpException ex) when (ex.Message.Contains(\"Storage zone\") && ex.Message.Contains(\"not found\"))\n{ /* create the zone in Bunny or fix the container name */ }","preventionTips":["Confirm the storage zone exists in the Bunny dashboard under the matching account.","Ensure the AccessKey belongs to the account that owns the zone.","Avoid deleted zones; the lookup skips Deleted zones."],"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"}