ChristianWagner
ChristianWagner

Reputation: 49

REDIS (json and search modules) requirepass causing errors

When no password is set for redis, my webpage works fine, no errors in powershell, it adds keys just fine when i submit information from the website. As soon as i set a password, i start getting a ton of errors such as : SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data && URIError: URI malformed

Does it have something to do with how I'm setting up the .env.local? I use:

REDIS_URL = redis://192.168.1.157:6379 and it works fine, but when i set the password to "secret_password" and then do this: REDIS_URL = redis://default:[email protected]:6379 everything breaks. Am i not formatting it correctly? The password is correct since i can go into redis console and do AUTH.

As soon as i revert the REDIS_URL everything stars working again, so that is the only thing i can find. Additionally, the format of redis://username:password@host:port should work since i used it earlier with an official redis aws instance and it worked.

Any tips on what could be the problem and how to fix it would be appreciated. Thanks, Christian

Upvotes: 1

Views: 377

Answers (1)

ChristianWagner
ChristianWagner

Reputation: 49

Apparently passwords (in VScode app .env.local REDIS_URL)can only be numbers and letters, no special characters. In my case, simply removing the "%" at the end of my password (ex. secret_password% does not work but secret_password does) solved my problem. I do not know if this is the actual fix, but after trying 500 other things to no avail, this seemed to be the fix. It was the only thing I changed.

Upvotes: 1

Related Questions