Incorrect error message `MasterNotFoundError: No master found for 'pre'` when timeout.
See original GitHub issueVersion: 2.10.6 Platform: 3.6 on win 10
Description:
if socket_timeout=0.1
:
sentinel = Sentinel([("192.168.0.10", 26379),("192.168.0.11", 26379),("192.168.0.12", 26379)], password='xxxxxx', socket_timeout=0.1)
sentinel.discover_master('pre')
got error:
C:\Anaconda3\lib\site-packages\redis\sentinel.py in discover_master(self, service_name)
221 sentinel, self.sentinels[0])
222 return state['ip'], state['port']
--> 223 raise MasterNotFoundError("No master found for %r" % (service_name,))
224
225 def filter_slaves(self, slaves):
MasterNotFoundError: No master found for 'pre'
But remove socket_timeout :
sentinel = Sentinel([("192.168.0.10", 26379),("192.168.0.11", 26379),("192.168.0.12", 26379)], password='xxxxxx')
sentinel.discover_master('pre')
got ('192.168.0.12', 6316)
This misleading message waste me lot of time .
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Incorrect error message `MasterNotFoundError: No master ...
In this particular case, the redis-py Sentinel code catches the TimeoutError and tries the next Sentinel server. If none of the Sentinel servers ......
Read more >MasterNotFoundError using redis-py when connecting to ...
I face the redis.sentinel.MasterNotFoundError: No master found for 'mymaster' error. How can I solve this? Thanks. python ...
Read more >Strange Issue: from redis-py client
I have two redis-servers instances running at port 6379, 6380 on the same box and ... MasterNotFoundError: No master found for 'mymaster' ...
Read more >redis 2.10.6
If no server is found, a MasterNotFoundError or SlaveNotFoundError is raised. Both exceptions are subclasses of ConnectionError. When trying to connect to a ......
Read more >Videoder apk direct for pc
external command, 'React/RCTEventDispatcher.h' file not found ... error: refname refs/heads/master not found error: refs/remotes/origin/PLAT-4366 does not ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
How did you solve this please?
Setting
socket_timeout
configures the socket to raise a timeout aftersocket_timeout
seconds have elapsed. Setting this value too low for your environment will cause every command to a Redis or Sentinel server to timeout.In this particular case, the redis-py Sentinel code catches the
TimeoutError
and tries the next Sentinel server. If none of the Sentinel servers respond, theMasterNotFoundError
is raised.