redis/jedis · error · IllegalStateException

It is not allowed to create Pipeline from this

Error message

It is not allowed to create Pipeline from this ${getClass()}

What it means

UnifiedJedis.pipelined() needs a ConnectionProvider to obtain a connection for the pipeline. Some UnifiedJedis subclasses (e.g. cluster/failover setups where provider is null or unused) cannot create a plain pipeline, so Jedis throws IllegalStateException naming the concrete class.

Solutions

  1. Use the client type that supports pipelining (RedisClient / standalone UnifiedJedis with a provider).
  2. For cluster clients, use ClusterPipeline via the cluster-specific API instead.
  3. Build the client through its builder so a default ConnectionProvider is installed.
  4. Check whether your subclass overrides pipelined() or supports it before calling.

Example fix

// before
UnifiedJedis custom = new MyClusterClient(cfg);
AbstractPipeline p = custom.pipelined(); // throws
// after
RedisClient c = RedisClient.builder().endpoint(ep).build();
AbstractPipeline p = c.pipelined();
Defensive patterns

Strategy: type-guard

Validate before calling

AbstractPipeline p = null;
try { p = client.pipelined(); } catch (IllegalStateException e) { /* unsupported */ }

Type guard

// Java: feature-test via class or capability check
boolean supportsPipeline = !(client instanceof ClusterOrFailoverUnsupportedType)
    && client.pipelinedAvailable(); // if exposed; otherwise try-catch

Try / catch

try {
  AbstractPipeline p = client.pipelined();
} catch (IllegalStateException e) {
  // fall back to per-command execution
}

Prevention

When it happens

Trigger: Calling pipelined() on a client instance whose provider field is null — typically certain UnifiedJedis subclasses or custom clients that never install a ConnectionProvider (e.g. some failover/cluster configurations).

Common situations: Using pipelined() on RedisClusterClient-style or custom clients where pipelines aren't supported; constructing a bare UnifiedJedis in tests; mocking clients.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of redis/jedis@6dac31d4c2 (2026-09-08). Data as JSON: /api/errors/c76acde0339ba737. Report an issue: GitHub.

Appendix: source

Thrown at src/main/java/redis/clients/jedis/UnifiedJedis.java:5997

  }

  @Override
  public List<Double> tdigestByRank(String key, long... ranks) {
    return executeCommand(commandObjects.tdigestByRank(key, ranks));
  }

  @Override
  public List<Double> tdigestByRevRank(String key, long... ranks) {
    return executeCommand(commandObjects.tdigestByRevRank(key, ranks));
  }
  // RedisBloom commands

  /**
   * @return pipeline object
   */
  public AbstractPipeline pipelined() {
    if (provider == null) {
      throw new IllegalStateException("It is not allowed to create Pipeline from this " + getClass());
    } else if (provider instanceof MultiDbConnectionProvider) {
      return new MultiDbPipeline((MultiDbConnectionProvider) provider, commandObjects);
    } else {
      return new Pipeline(provider.getConnection(), true, commandObjects);
    }
  }

  /**
   * @return transaction object
   */
  public AbstractTransaction multi() {
    return transaction(true);
  }

  /**
   * @param doMulti {@code false} should be set to enable manual WATCH, UNWATCH and MULTI
   * @return transaction object
   */

View on GitHub (pinned to 6dac31d4c2)