weird bug with redis

421 views
Skip to first unread message

dederocks

unread,
Jul 18, 2013, 10:35:48 AM7/18/13
to web...@googlegroups.com
Hello,

I have encountered a weird bug using Redis. I understand it would be too complicated to get detailed help (software is running to supervise a machine), but I'm looking for cues on where to look.

Here is the problem:
I use redis to share variables between processes. After a while, I get the following error in web2py: 

<class 'redis.exceptions.ConnectionError'> Error -5 connecting localhost:6379. No address associated with hostname.

The instruction raising this message is never the same, allthough it's a redis command, of course: it always comes down to redis connexion missing that cannot be re-established (line 125 in redis' connection.py).

What is weird is that redis remains accessible from the other processes, e.g. the server still operates without any problem.
The only solution I've found so far to solve the problem is restarting web2py (touch /etc/uwsgi/web2py.xml), and then it works again.
Any cue from someone on what could be wrong?

Thanks, 
Andre

Niphlod

unread,
Jul 18, 2013, 8:15:25 PM7/18/13
to web...@googlegroups.com
seems a more general problem within the os than a bug with web2py and redis. although I'm a heavy user of redis, I never encountered that error.
this http://askubuntu.com/questions/142508/how-to-fix-5-no-address-associated-with-hostname-error-while-updating
is just a reference on a similar error on a totally different problem (resolving hostnames for apt sources) but indeed is related to the same "issue" : something is going on strangely on your server and it doesn't resolve properly what "localhost" is.
Shameless trial to fix the problem (read: it may work, but I can't test it cause I can't reproduce the error): try  replacing localhost with 127.0.0.1

dederocks

unread,
Jul 22, 2013, 4:38:37 AM7/22/13
to web...@googlegroups.com
Thanks A LOT Simone, that solved this problem!  Much much appreciated your help!!
Reply all
Reply to author
Forward
0 new messages