question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to connect to Redis with correct credentials

See original GitHub issue

I’m attempting to use a newly created Redis user. However, I’m getting the following error:

error: Uncaught (in promise) Error: -WRONGPASS invalid username-password pair

    throw new ErrorReplyError(line);
          ^
    at tryParseErrorReply (https://deno.land/x/redis@v0.25.4/protocol/reply.ts:205:11)
    at readReply (https://deno.land/x/redis@v0.25.4/protocol/reply.ts:55:7)
    at async RedisConnection.connectThunkified (https://deno.land/x/redis@v0.25.4/connection.ts:97:11)
    at async RedisConnection.connect (https://deno.land/x/redis@v0.25.4/connection.ts:126:5)
    at async connect (https://deno.land/x/redis@v0.25.4/redis.ts:2287:3)
    at async file://<location>

I’m essentially connecting to the following client via the following:

export const REDIS = await connect(parseURL(Deno.env.get("REDIS_URL")!));

When using my Redis default user, this code works fine. However, when using the new user, it doesn’t. I know the REDIS_URL environmental variable is correct because I’ve used it to access Redis via redis-cli -u <url>.

Please let me know if there’s any more information you need and thank you in advance.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
scott-lingcommented, May 31, 2022

@uki00a all good, I will add a couple tests for the new situations

  1. password passed no username passed
  2. password and username passed

Will let ya know when its ready to roll, I should be able to complete this tonight once other work is done (I am on GMT)

Thanks for the quick turn-around, this was a breaking issue for me so assume its same for a few others.

-Scott

2reactions
scott-lingcommented, May 31, 2022

suggest you update RedisConnectionOptions to support username?: string and also update authenticate function to check for username and adjust redis command as needed for password/default auth "AUTH", password and if exists "AUTH", username, password

not sure if this is being progressed, if not I am more than willing push these changes as a PR let me know, as I am using a modified local repo for production currently with redis cloud.

also I am not sure where to add tests for this as there are connection tests in /tests/commands/general and /tests/commands/connection polite suggestions encouraged 😉

@uki00a @keroxp I can push a PR from my local branch anytime as its done and I am using in production. (ps. never done a PR request/push to opensource before, but my local version <branched as #300> is ready to be pushed as a PR, if I am added as a contributor.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not connect to Redis at 127.0.0.1:6379 - Stack Overflow
After installing redis , type from terminal : redis-server. And Redis-Server will be started.
Read more >
WRONGPASS invalid username-password pair #1591 - GitHub
I have the same issue as @darklight147. Setting the username to redis://default:password@ip or empty string redis://:password@ip does not help.
Read more >
Unable to connect to Redis 6 as non-default user - GitLab
Attempt to configure GitLab to connect to Redis as that user. ... pods still crash with an error indicating the credentials are incorrect....
Read more >
Troubleshoot connecting to an ElastiCache for Redis cluster
If you recently created the cluster, verify that the cluster creation completed and that the cluster is ready to accept connections.
Read more >
Could not connect to redis connection refused - Fix it easily
The most common reason for the connection refused error is that the Redis-Server is not started. Redis server should be started to use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found