Wrong error message is added to exception
See original GitHub issueHi!
I noticed that I get the wrong error message in the pika.exceptions.ConnectionClosed
(“wrong” in the sense of “only half the truth”: one of two error messages, and actually the less relevant one).
Basically, pika tries IPv4, when that fails (because my SSL settings are wrong), it tried IPv6, and if that fails too, only the error message about the IPv6 attempt is handed back. This is a problem for me because I want to use IPv4, and it’s this failure (wrong SSL flag) that I actually need to identify. The fact that IPv6 fails is unimportant to me.
(If I could tell pika to only use IPv4 and not try IPv6, that would solve this for me, but I think that it would be interesting to users in general to know all the failures).
I’m using pika 0.12.0. I did not find anything related to IPv6 in the pika docs (https://pika.readthedocs.io/en/stable/intro.html).
# This is the failure in IPv4:
pika.adapters.base_connection - ERROR - Connection to 999.999.22.44:5672 failed: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:661)
# This is the failure in IPv6:
pika.adapters.base_connection - ERROR - Connection to 2001:xxx.yyy.zzz failed: [Errno 101] Network is unreachable
# This is what gets handed to the caller:
pika.adapters.blocking_connection - ERROR - Connection open failed - 'Connection to 2001:xxx.yyy.zzz failed: [Errno 101] Network is unreachable'
# This is what I receive:
my-application - INFO - Caught exception: Connection to 2001:xxx.yyy.zzz failed: [Errno 101] Network is unreachable
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thank you! I’ll be sure to include this in the next release.
Hello,
I used the following script to try to reproduce: repro.py.txt
Here is the transcript when trying to connect to IPv4 localhost and IPv6. I can’t seem to reproduce what you report: transcript.txt