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.

Wrong error message is added to exception

See original GitHub issue

Hi! 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lukebakkencommented, Sep 11, 2018

Thank you! I’ll be sure to include this in the next release.

0reactions
lukebakkencommented, Nov 6, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Messages: Examples, Best Practices & Common Mistakes
4 common mistakes with error messages · 1. Ambiguity · 2. Condescending language/blaming the user · 3. Poor placement of error messages ·...
Read more >
c# - Exception error message with incorrect line number
When an exception is thrown in an Asp.Net web page, an error message is displayed with the complete stack trace. Example below: Stack...
Read more >
Best Practices for exceptions - .NET - Microsoft Learn
Learn best practices for exceptions, such as using try/catch/finally, handling common conditions without exceptions, and using predefined .
Read more >
7 Common Mistakes You Should Avoid When Handling Java ...
Handling an exception in Java is one of the most common but not necessarily one of the easiest tasks. Here are several common...
Read more >
30. Errors and Exception Handling | Python Tutorial
An exception is an error that happens during the execution of a program. Exceptions are known to non-programmers as instances that do not ......
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