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.

0.9.5 doesn't work without defining password for redis anymore

See original GitHub issue

Hello!

After upgrading to 0.9.5 if no password defined for redis url will throw an error:

redis.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a bytes, string, int or float first.

redis.exceptions.AuthenticationWrongNumberOfArgsError: wrong number of arguments for 'auth' command On 0.9.4 works fine.

BR, Dacian

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

2reactions
LuberLindercommented, Jul 27, 2022

That error happend to me too and also only on the production server. What I did was:

  1. Setting password “mypassword” for redis on the server (by editting /etc/redis/redis.conf or via redis-cli):
root@server:~# redis-cli 
127.0.0.1:6379> config set requirepass mypassword
127.0.0.1:6379> quit
root@server:~# service redis-server restart
  1. Adding DEFENDER_REDIS_URL to Django’s settings.py:
DEFENDER_REDIS_URL = 'redis://:mypassword@localhost:6379/0'

That’s it. To see blocked users/ips:

root@server:~# redis-cli
127.0.0.1:6379> auth mypassword
127.0.0.1:6379> scan 0

To quick check, for example, if the user “admin” is blocked:

127.0.0.1:6379> get defender:blocked:username:admin

To quick unblock user “admin”:

127.0.0.1:6379> del defender:blocked:username:admin
0reactions
jab3zcommented, Jun 24, 2022

Hello,

I haven’t debugged why and how the error occurs, simply found the faulty package, checked the release log to not have major changes and reverted to the old version.

Tested only locally with Redis running on docker, but the following URLs were throwing the error when login into admin:

redis://127.0.0.1:6379
redis://127.0.0.1:6379/1
redis://localhost:6379
redis://localhost:6379/1

Let me know if you’d like me to raise a PR with the fix.

BR, Dacian

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set password for Redis? - Stack Overflow
Config set requirepass "myPassword" this command is not working for me, when I execute this command then it runs with no error. Then...
Read more >
How do I restart redis that I installed with brew? - Super User
You can run touch /usr/local/etc/redis. conf or similar to create an empty configuration file. Then run brew services restart redis and redis-cli ,...
Read more >
How to Install and Configure WordPress Redis Cache
Installing WordPress Redis cache can help in increasing your website's performance. Learn how to install Redis cache on WordPress websites.
Read more >
django-defender - Bountysource
0.9.5 doesn't work without defining password for redis anymore $ 0. Created 6 months ago in jazzband/django-defender with 5 comments. Hello! After ...
Read more >
Using Redis - Hangfire Documentation
Hangfire with Redis job storage implementation processes jobs much faster than with SQL ... improvement with empty jobs (method that does not do...
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