Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
Redis: ERR wrong number of arguments for 'auth' command

I'm using redis with nodejs. Version: "redis": "^3.1.2"

When my server connects to redis, I get the following error:

ERR wrong number of arguments for 'auth' command

I'm guessing it has something to do with the URL, which looks like this:

redis://h:<password>@<url>:<port>

My redis is hosted by Heroku and I'm unable to change the URL. And have no idea how can I make it work. Any ideas/solutions much appreciated.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Redis Version < 6.0.0 and node-redis >=3.1.0 , redis://h:<password>@<url>:<port> will not work and throw ERR wrong number of arguments for 'auth' command.

Solution: redis://<password>@<url>:<port> works ie: remove username from the URL.

This should fix the problem that you are facing.

For other versions:

Redis Version < 6.0.0 and node-redis <=3.0.2 , redis://h:<password>@<url>:<port> works.

Redis Version >= 6.0.0 and node-redis(any version), both redis://<username>:<password>@<url>:<port>(when username in redis ACL is set to custom username) and redis://<password>@<url>:<port> will work.

The reason is:

  • node-redis made the changes to support Redis-6, as per releasenote.

  • Redis-6 supports username in ALC. Before v6, Redis did not include the notion of users, and the only authentication strategy was a single login password. Reference

  • Whenever you attach Redis addon to Heroku container, the environment variable REDIS_URL is set and the value is Connection URL of format: redis://h:<password>@<url>:<port>. This "h" is a fake/dummy/placeholder username because some clients(eg: node-redis) could not correctly handle a blank username in the URL. After the release of ACLs in Redis 6, clients began to support the new AUTH command that uses 2 arguments (username and password). Clients that attempt to pass the h username to the AUTH will result in an above error on Redis versions 4 and 5. Reference

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!