This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1286827 - fedmsg-tail TypeError when network connection fails
fedmsg-tail TypeError when network connection fails
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: fedmsg (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Infrastructure SIG
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-30 15:34 EST by Zbigniew Jędrzejewski-Szmek
Modified: 2016-12-20 11:26 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-20 11:26:37 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Zbigniew Jędrzejewski-Szmek 2015-11-30 15:34:51 EST
Description of problem:
$ fedmsg-tail --pretty
Traceback (most recent call last):
  File "/usr/bin/fedmsg-tail", line 9, in <module>
    load_entry_point('fedmsg==0.16.2', 'console_scripts', 'fedmsg-tail')()
  File "/usr/lib/python2.7/site-packages/fedmsg/commands/tail.py", line 211, in tail
    return command.execute()
  File "/usr/lib/python2.7/site-packages/fedmsg/commands/__init__.py", line 104, in execute
    return self.run()
  File "/usr/lib/python2.7/site-packages/fedmsg/commands/tail.py", line 187, in run
    for name, ep, topic, message in fedmsg.tail_messages(**self.config):
  File "/usr/lib/python2.7/site-packages/fedmsg/__init__.py", line 109, in tail_messages
    for item in __local.__context.tail_messages(**kw):
  File "/usr/lib/python2.7/site-packages/fedmsg/core.py", line 325, in tail_messages
    for msg in self._poll(poller, subs):
  File "/usr/lib/python2.7/site-packages/fedmsg/core.py", line 397, in _poll
    yield self._run_socket(s, name, ep, watched_names)
  File "/usr/lib/python2.7/site-packages/fedmsg/core.py", line 409, in _run_socket
    if not validate or fedmsg.crypto.validate(msg, **self.c):
  File "/usr/lib/python2.7/site-packages/fedmsg/crypto/__init__.py", line 256, in validate
    return backend.validate(message, **cfg)
  File "/usr/lib/python2.7/site-packages/fedmsg/crypto/x509.py", line 148, in validate
    **config)
  File "/usr/lib/python2.7/site-packages/fedmsg/crypto/x509.py", line 250, in _load_remote_cert
    response = requests.get(location)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 69, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 370, in send
    timeout=timeout
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 344, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 314, in _raise_timeout
    if 'timed out' in str(err) or 'did not complete (read)' in str(err):  # Python 2.6
TypeError: __str__ returned non-string (type SysCallError)

Version-Release number of selected component (if applicable):
python-fedmsg-commands-0.16.2-2.fc23.noarch

How reproducible:
Dunno.
Comment 1 Ralph Bean 2016-03-17 10:55:23 EDT
Well, this is kind of what we want.. :/

The error comes when it tries to load the remote CA cert to validate that the message you received is signed appropriately.  If that CA cert is for some reason unavailable, what should we do?

We don't want to let the message be approved erroneously.  An attacker could exploit that.  Raising an exception here is (I think) the best course of action.
Comment 2 Zbigniew Jędrzejewski-Szmek 2016-03-17 11:04:57 EDT
Yeah, I'm not saying that it should continue. But it shouldn't throw a TypeError.
And I don't think it should show the traceback either. Users don't like tracebacks ;) Basically I'd expect a one-line error like "Connection to xxx failed.".
Comment 3 Yanko Kaneti 2016-03-25 04:27:45 EDT
On a similar note, this happens from time to time
$ fedmsg-tail --really-pretty  --topic org.fedoraproject.prod.buildsys.build.state.change
.....<successfult pretty dumps>..........
Traceback (most recent call last):
  File "/usr/bin/fedmsg-tail", line 9, in <module>
    load_entry_point('fedmsg==0.16.4', 'console_scripts', 'fedmsg-tail')()
  File "/usr/lib/python2.7/site-packages/fedmsg/commands/tail.py", line 211, in tail
    return command.execute()
  File "/usr/lib/python2.7/site-packages/fedmsg/commands/__init__.py", line 104, in execute
    return self.run()
  File "/usr/lib/python2.7/site-packages/fedmsg/commands/tail.py", line 187, in run
    for name, ep, topic, message in fedmsg.tail_messages(**self.config):
  File "/usr/lib/python2.7/site-packages/fedmsg/__init__.py", line 109, in tail_messages
    for item in __local.__context.tail_messages(**kw):
  File "/usr/lib/python2.7/site-packages/fedmsg/core.py", line 325, in tail_messages
    for msg in self._poll(poller, subs):
  File "/usr/lib/python2.7/site-packages/fedmsg/core.py", line 397, in _poll
    yield self._run_socket(s, name, ep, watched_names)
  File "/usr/lib/python2.7/site-packages/fedmsg/core.py", line 416, in _run_socket
    if not validate or fedmsg.crypto.validate(msg, **self.c):
  File "/usr/lib/python2.7/site-packages/fedmsg/crypto/__init__.py", line 256, in validate
    return backend.validate(message, **cfg)
  File "/usr/lib/python2.7/site-packages/fedmsg/crypto/x509.py", line 149, in validate
    crl = M2Crypto.X509.load_crl(crl)
  File "/usr/lib64/python2.7/site-packages/M2Crypto/X509.py", line 1102, in load_crl
    raise X509Error(Err.get_error())
M2Crypto.X509.X509Error: 140414732375808:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:701:Expecting: X509 CRL


I would expect a one line about the certificate error, but not a traceback or stopping the tail altogether.
Comment 4 Fedora Admin XMLRPC Client 2016-04-04 15:54:33 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 5 Fedora End Of Life 2016-11-24 08:51:09 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 6 Fedora End Of Life 2016-12-20 11:26:37 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.