abpframework/abp · error · Exception

Error while checking blob existence: {ex.Message}

Error message

Error while checking blob existence: {ex.Message}

What it means

Thrown by BunnyBlobProvider.BlobExistsAsync as a catch-all wrapper around any non-404 exception that occurs while listing storage objects (GetStorageObjectsAsync) to determine blob existence. The original exception is preserved as InnerException and its Message is embedded. BunnyCDNStorageException messages containing '404' are treated as 'does not exist' (return false) and are not wrapped.

Source

Thrown at framework/src/Volo.Abp.BlobStoring.Bunny/Volo/Abp/BlobStoring/Bunny/BunnyBlobProvider.cs:123

        {
            var fullBlobPath = $"/{containerName}/{blobName}";
            var directoryPath = Path.GetDirectoryName(fullBlobPath)?.Replace('\\', '/') + "/";

            if (string.IsNullOrWhiteSpace(directoryPath))
            {
                throw new Exception("Invalid directory path generated from blob name.");
            }

            var objects = await bunnyStorage.GetStorageObjectsAsync(directoryPath);
            return objects?.Any(o => o.FullPath == fullBlobPath) == true;
        }
        catch (BunnyCDNStorageException ex) when (ex.Message.Contains("404"))
        {
            return false;
        }
        catch (Exception ex)
        {
            throw new Exception($"Error while checking blob existence: {ex.Message}", ex);
        }
    }

    protected virtual async Task<BunnyCDNStorage> GetBunnyCDNStorageAsync(BlobProviderArgs args)
    {
        var configuration = args.Configuration.GetBunnyConfiguration();
        var containerName = GetContainerName(args);
        var region = configuration.Region ?? "de";

        return await BunnyClientFactory.CreateAsync(
            configuration.AccessKey,
            containerName,
            region);
    }

    protected virtual string GetContainerName(BlobProviderArgs args)
    {
        var configuration = args.Configuration.GetBunnyConfiguration();

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Inspect InnerException for the root cause (network, auth, deserialization).
  2. Retry transient network failures with backoff.
  3. Verify the Bunny AccessKey and that the storage zone is reachable.
  4. If the inner error is a Bunny API/schema change, update the Bunny CDN SDK package.

Example fix

// before
var exists = await container.ExistsAsync(name);

// after
bool exists;
try
{
    exists = await container.ExistsAsync(name);
}
catch (Exception ex) when (ex.Message.Contains("Error while checking blob existence"))
{
    _logger.LogWarning(ex, "Bunny existence check failed; treating as retryable");
    exists = await retryPolicy.ExecuteAsync(() => container.ExistsAsync(name));
}
Defensive patterns

Strategy: try-catch

Validate before calling

// No pre-call guard for arbitrary network failures; instead verify config:
if (configuration.AccessKey.IsNullOrWhiteSpace())
    throw new InvalidOperationException("Bunny AccessKey is not configured.");

Type guard

bool bunnyConfigured = !configuration.AccessKey.IsNullOrWhiteSpace();

Try / catch

try { await container.ExistsAsync(blobName); }
catch (Exception ex) when (ex.Message.Contains("Error while checking blob existence"))
{
    var root = ex.InnerException?.Message ?? ex.Message;
    // branch on root: retry for network, fix key for auth
    await retryPolicy.ExecuteAsync(() => container.ExistsAsync(blobName));
}

Prevention

When it happens

Trigger: Any error during the Bunny GetStorageObjectsAsync call that is not a 404: network failures, authentication errors, 5xx responses, malformed responses, or SDK-internal exceptions. The wrapper converts these into a single Exception so callers see a uniform 'Error while checking blob existence' failure.

Common situations: Transient network blips, expired/invalid Bunny access keys, Bunny API rate limiting, or a changed Bunny SDK response shape that breaks deserialization. Surfaces on Save/Delete/Exists/Get since all path through BlobExistsAsync.

Related errors


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/c3e52805e2ef99e2. Report an issue: GitHub.