Skip to content

[Bug]: ioredis is IPv4 only, add IPv6 support #15290

Description

@snapydziuba

What happened?

ioredis defaults to IPv4. On an IPv6 single-stack cluster this causes
ENOTFOUND because the Redis service has no A record. Allow either address
family so REDIS_URI-based connections can resolve IPv6-only services.
Changing Redis.defaultOptions.family = 0 allows for both.

My current workaround is:

// This module is loaded through NODE_OPTIONS before LibreChat creates Redis
// clients. It is intentionally outside /app, so use the absolute module path.
try {
  const Redis = require('/app/node_modules/ioredis');

  if (Redis && Redis.defaultOptions.family === 4) {
    Redis.defaultOptions.family = 0;
  }
} catch {
  // ioredis is not available in this process; there is nothing to patch.
}

Version Information

Current Version

Steps to Reproduce

Start Librechat against a Redis DNS Record without an A Record.

What browsers are you seeing the problem on?

No response

Relevant log output

-

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. PiedPiper911 commented on Aug 28, 2026

    @PiedPiper911

    I've opened the PR for this: #15309

    Sets on the shared ioredis options in — the resolver tries IPv4 first, then IPv6, so IPv6-only clusters connect while IPv4 behavior is unchanged. Applied to both single-node and cluster clients.

  2. added
    🗺️ Backend Platformcodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)
    🗺️ Cache & Storagecodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)
    🗺️ Backend Infracodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working🗺️ Backend Infracodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)🗺️ Backend Platformcodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)🗺️ Cache & Storagecodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)🗺️ Concurrency Cachecodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)🗺️ Platform Securitycodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions