Skip to content

Redis cluster connection issue #1719

Closed
Closed
@tiwariprateek

Description

@tiwariprateek

Hi,
I was trying to establish a connection to redis cluster, using createCluster(). But was not able to. Following was the error returned :
ReplyError: NOAUTH Authentication required.
at parseError (/redis-parser/lib/parser.js:179:12)
at parseType (/redis-parser/lib/parser.js:302:14)
(Use node --trace-warnings ... to show where the warning was created)
(node:89375) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:89375) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Also, I have verified the connection string and there is no issue in terms of that. Here's the code snippet.
(async () => {
const cluster = createCluster({
rootNodes: [
{
url: 'redis://:CLUSTER_PASSWORD@CLUSTER_IP:CLUSTER_PORT'
}
]
});

cluster.on('error', (err) => console.log('Redis Cluster Error', err));
cluster.on('connect', () => {
    console.log("Redis client connected. RedisHost");
  });
await cluster.connect();

})();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions