quarkusio/quarkus · error · IllegalArgumentException

`" + name + "` must not be blank

Error message

`" + name + "` must not be blank

What it means

Validation utility precondition check: a String argument was non-null but blank (only whitespace, e.g. "" or " "). The Quarkus Redis client rejects blank keys/field names because they almost always indicate a construction bug and are invalid Redis key semantics.

Source

Thrown at extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/Validation.java:78

        return array;
    }

    public static byte[] notNullOrEmpty(byte[] array, String name) {
        if (array == null) {
            throw new IllegalArgumentException("`" + name + "` must not be `null`");
        }
        if (array.length == 0) {
            throw new IllegalArgumentException("`" + name + "` must not be empty");
        }
        return array;
    }

    public static String notNullOrBlank(String v, String name) {
        if (v == null) {
            throw new IllegalArgumentException("`" + name + "` must not be `null`");
        }
        if (v.isBlank()) {
            throw new IllegalArgumentException("`" + name + "` must not be blank");
        }
        return v;
    }

    static <X> void notNullOrEmpty(Collection<X> col, String name) {
        if (col == null) {
            throw new IllegalArgumentException("`" + name + "` must not be `null`");
        }
        if (col.size() == 0) {
            throw new IllegalArgumentException("`" + name + "` must not be empty");
        }
    }

    static <K, V> void notNullOrEmpty(Map<K, V> map, String name) {
        if (map == null) {
            throw new IllegalArgumentException("`" + name + "` must not be `null`");
        }
        if (map.size() == 0) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Validate that the composed key is non-blank before calling Redis (fail fast in your own code with a clear message)
  2. Give the config property a non-empty value or a sensible programmatic default
  3. Trim/normalize inputs and reject blank ones at your API boundary

Example fix

// before
String key = prefix + ":user:" + userId; // prefix is ""
redis.value().get(key);
// after
if (prefix == null || prefix.isBlank()) {
    throw new IllegalStateException("Key prefix must be configured");
}
String key = prefix + ":user:" + userId;
redis.value().get(key);
Defensive patterns

Strategy: validation

Validate before calling

String normalized = key == null ? null : key.strip(); if (normalized == null || normalized.isEmpty()) { throw new IllegalArgumentException("key must not be blank"); }

Type guard

boolean isNotBlank(String s) { return s != null && !s.isBlank(); }

Try / catch

try { redis.value().get(key); } catch (IllegalArgumentException e) { log.error("Blank Redis key: {}", e.getMessage()); throw new InvalidCacheKeyException(e.getMessage(), e); }

Prevention

When it happens

Trigger: Passing "" or whitespace strings as key, field, or member — commonly from String.trim() results, empty environment/config values, concatenations where a variable part is empty.

Common situations: Empty quarkus.redis.<name> key-prefix config property; empty tenant/segment variable in a composite key like prefix + ':' + tenant; HTTP request with missing parameter defaulting to empty string.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/d1ec411bb62ef038. Report an issue: GitHub.