obukhov / redis-inventory

CLI tool to see redis memory usage by keys in hierarchical way. Think of disk inventory but for redis.
MIT License
237 stars 31 forks source link

Special Characters in password lead to "too many colons in address" error #49

Open ArMot opened 2 years ago

ArMot commented 2 years ago

Hi, I have set a password for redis using password generators. it contains special characters (but not colon). But when I try:

redis-inventory inventory redis://password$%^*@localhost:63795/3

I get this error:

INF Start scanning FTL Can't create redis client error="dial tcp: address redis://:password$%^*@localhost:63795/3: too many colons in address"

what should I do ?

onfleet-ablair commented 2 years ago

You can work around this,

$ python3
>>> import urllib.parse
>>> urllib.parse.quote('sp#c!al ch@rs')
'sp%23c%21al%20ch%40rs'

$ docker run --rm dclg/redis-inventory inventory --output=chart redis://:'sp%23c%21al%20ch%40rs'@my.redis.server
hartleybrody commented 1 year ago

I am also getting an error about "too many colons in address" but I don't have any special characters in my password. It's all alphanumeric, of the format: rediss://user:pass@host-with-dashes.and.tld:port. Interestingly, the error message echos back the connection URL but it has appended an extra colon onto the end of it, so maybe there's a trailing colon being added somewhere?