{"record":{"id":"8b38f4e18ba8eb24","repo":"abpframework/abp","slug":"failed-to-validate-storage-zone-containername","errorCode":null,"errorMessage":"Failed to validate storage zone '{containerName}': {ex.Message}","messagePattern":"Failed to validate storage zone '(.+?)': (.+?)","errorType":"exception","errorClass":"AbpException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/BunnyBlobProvider.cs","lineNumber":162,"sourceCode":"            : BlobNormalizeNamingService.NormalizeContainerName(args.Configuration, configuration.ContainerName!);\n    }\n\n    protected virtual async Task ValidateContainerExistsAsync(\n        string containerName,\n        BunnyBlobProviderConfiguration configuration\n        )\n    {\n        try\n        {\n            await BunnyClientFactory.EnsureStorageZoneExistsAsync(\n                configuration.AccessKey,\n                containerName,\n                configuration.Region ?? \"de\",\n                configuration.CreateContainerIfNotExists);\n        }\n        catch (Exception ex)\n        {\n            throw new AbpException(\n                $\"Failed to validate storage zone '{containerName}': {ex.Message}\",\n                ex);\n        }\n    }\n}\n","sourceCodeStart":144,"sourceCodeEnd":168,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/BunnyBlobProvider.cs#L144-L168","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read InnerException.Message to identify the underlying cause (missing zone, creation failure, auth).","If the zone legitimately does not exist, set CreateContainerIfNotExists=true or create it in the Bunny dashboard.","Verify the AccessKey and region are correct and that the Bunny API is reachable.","Retry transient network/API errors with backoff."],"exampleFix":"// before\n\"Bunny\": {\n  \"AccessKey\": \"...\",\n  \"ContainerName\": \"my-zone\"\n}\n\n// after (auto-create the zone)\n\"Bunny\": {\n  \"AccessKey\": \"...\",\n  \"ContainerName\": \"my-zone\",\n  \"CreateContainerIfNotExists\": true\n}","handlingStrategy":"try-catch","validationCode":"// Pre-validate that the zone exists and the key is set before saving:\nif (configuration.AccessKey.IsNullOrWhiteSpace())\n    throw new InvalidOperationException(\"Bunny AccessKey is not configured.\");","typeGuard":"bool canValidateZone = !configuration.AccessKey.IsNullOrWhiteSpace() && !containerName.IsNullOrWhiteSpace();","tryCatchPattern":"try { await container.SaveAsync(blobName, stream); }\ncatch (AbpException ex) when (ex.Message.Contains(\"Failed to validate storage zone\"))\n{\n    var cause = ex.InnerException?.Message ?? ex.Message;\n    // cause guides: create zone, fix key, or retry\n}","preventionTips":["Ensure CreateContainerIfNotExists matches whether the zone may be absent.","Keep the AccessKey valid; verify the Bunny API is reachable.","Inspect InnerException to distinguish missing-zone from creation/network failures."],"tags":["bunny","storage-zone","configuration","network","abp"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}