{"record":{"id":"f452c71cb281c6a1","repo":"abpframework/abp","slug":"container-name-must-be-between-minlength-and-ma","errorCode":null,"errorMessage":"Container name must be between {MinLength} and {MaxLength} characters. Current length: {normalizedName.Length}","messagePattern":"Container name must be between (.+?) and (.+?) characters\\. Current length: (.+?)","errorType":"exception","errorClass":"AbpException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/BunnyBlobNamingNormalizer.cs","lineNumber":43,"sourceCode":"            var normalizedName = containerName\n                .Trim()\n                .ToLowerInvariant();\n\n            // Remove any invalid characters\n            normalizedName = Regex.Replace(normalizedName, \"[^a-z0-9-]\", string.Empty);\n\n            // Validate structure\n            if (!ValidCharactersRegex.IsMatch(normalizedName))\n            {\n                throw new AbpException(\n                    $\"Container name contains invalid characters: {containerName}. \" +\n                    \"Only lowercase letters, numbers, and hyphens are allowed.\");\n            }\n\n            // Validate length\n            if (normalizedName.Length < MinLength || normalizedName.Length > MaxLength)\n            {\n                throw new AbpException(\n                    $\"Container name must be between {MinLength} and {MaxLength} characters. \" +\n                    $\"Current length: {normalizedName.Length}\");\n            }\n\n            return normalizedName;\n        }\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":52,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/BunnyBlobNamingNormalizer.cs#L25-L52","documentation":"Thrown by BunnyBlobNamingNormalizer.NormalizeContainerName when the normalized container name length is outside the allowed range [MinLength=4, MaxLength=64]. The check runs after character normalization, so the measured length is the post-strip length. Bunny storage-zone names must be 4-64 characters of lowercase letters, digits, and hyphens.","triggerScenarios":"A Bunny container name that, after trim/lowercase/strip, is shorter than 4 or longer than 64 characters. Triggered on the first blob operation that normalizes the container name.","commonSituations":"A too-short container name like 'ab' or 'app', an overly long generated name, or a container name that lost many characters during the invalid-character strip and fell below the minimum.","solutions":["Choose a container name between 4 and 64 characters using only lowercase letters, digits, and hyphens.","If the original name loses characters during normalization, pick a name already in the valid alphabet so its length is stable.","Set an explicit ContainerName in the Bunny configuration within the allowed range."],"exampleFix":"// before\n\"Bunny\": { \"ContainerName\": \"ab\" }\n\n// after\n\"Bunny\": { \"ContainerName\": \"app-media\" }","handlingStrategy":"validation","validationCode":"const int Min = 4, Max = 64;\nif (containerName.Length < Min || containerName.Length > Max)\n    throw new ArgumentException($\"Container name length must be {Min}-{Max}.\");","typeGuard":"static bool IsValidBunnyContainerLength(string name) => name.Length >= 4 && name.Length <= 64;","tryCatchPattern":"try { NormalizeContainerName(name); }\ncatch (AbpException ex) when (ex.Message.Contains(\"between\"))\n{ /* choose a name within 4-64 chars */ }","preventionTips":["Keep Bunny container names between 4 and 64 characters.","Account for characters stripped during normalization when sizing the name.","Validate length at configuration time."],"tags":["bunny","validation","container-name","configuration","abp"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}