abpframework/abp · error · AbpException
Container name must be between {MinLength} and {MaxLength} c
Error message
Container name must be between {MinLength} and {MaxLength} characters. Current length: {normalizedName.Length} What it means
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.
Source
Thrown at framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/BunnyBlobNamingNormalizer.cs:43
var normalizedName = containerName
.Trim()
.ToLowerInvariant();
// Remove any invalid characters
normalizedName = Regex.Replace(normalizedName, "[^a-z0-9-]", string.Empty);
// Validate structure
if (!ValidCharactersRegex.IsMatch(normalizedName))
{
throw new AbpException(
$"Container name contains invalid characters: {containerName}. " +
"Only lowercase letters, numbers, and hyphens are allowed.");
}
// Validate length
if (normalizedName.Length < MinLength || normalizedName.Length > MaxLength)
{
throw new AbpException(
$"Container name must be between {MinLength} and {MaxLength} characters. " +
$"Current length: {normalizedName.Length}");
}
return normalizedName;
}
}
}
View on GitHub (pinned to 7ed43b1931)
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.
Example fix
// before
"Bunny": { "ContainerName": "ab" }
// after
"Bunny": { "ContainerName": "app-media" } Defensive patterns
Strategy: validation
Validate before calling
const int Min = 4, Max = 64;
if (containerName.Length < Min || containerName.Length > Max)
throw new ArgumentException($"Container name length must be {Min}-{Max}."); Type guard
static bool IsValidBunnyContainerLength(string name) => name.Length >= 4 && name.Length <= 64;
Try / catch
try { NormalizeContainerName(name); }
catch (AbpException ex) when (ex.Message.Contains("between"))
{ /* choose a name within 4-64 chars */ } Prevention
- Keep Bunny container names between 4 and 64 characters.
- Account for characters stripped during normalization when sizing the name.
- Validate length at configuration time.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Container name contains invalid characters: {containerName}.
- Job names must be empty when the filter mode is None.
- Job names cannot be empty when the filter mode is Include or
- Invalid directory path generated from blob name.
- Failed to validate storage zone '{containerName}': {ex.Messa
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/f452c71cb281c6a1.
Report an issue: GitHub.