Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange error displayed to log during unit tests #243

Open
tisnik opened this issue Feb 21, 2019 · 0 comments
Open

Strange error displayed to log during unit tests #243

tisnik opened this issue Feb 21, 2019 · 0 comments
Labels

Comments

@tisnik
Copy link
Member

tisnik commented Feb 21, 2019

See:
https://ci.centos.org/job/devtools-fabric8-analytics-data-model-fabric8-analytics/420/console

test/test_data_importer.py::test_get_exception_msg Top level Sentry exception caught - failed creating log record
b'prefix: hello world!'
b'Traceback (most recent call last):\n  File "/root/payload/venv/lib/python3.4/site-packages/raven/handlers/logging.py", line 91, in emit\n    self.format(record)\n  File "/usr/lib64/python3.4/logging/__init__.py", line 828, in format\n    return fmt.format(record)\n  File "/usr/lib64/python3.4/logging/__init__.py", line 573, in format\n    record.exc_text = self.formatException(record.exc_info)\n  File "/usr/lib64/python3.4/logging/__init__.py", line 523, in formatException\n    traceback.print_exception(ei[0], ei[1], tb, None, sio)\n  File "/usr/lib64/python3.4/traceback.py", line 169, in print_exception\n    for line in _format_exception_iter(etype, value, tb, limit, chain):\n  File "/usr/lib64/python3.4/traceback.py", line 146, in _format_exception_iter\n    for value, tb in values:\n  File "/usr/lib64/python3.4/traceback.py", line 125, in _iter_chain\n    context = exc.__context__\nAttributeError: \'NoneType\' object has no attribute \'__context__\'\n'
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib64/python3.4/logging/__init__.py", line 978, in emit
    msg = self.format(record)
  File "/usr/lib64/python3.4/logging/__init__.py", line 828, in format
    return fmt.format(record)
  File "/usr/lib64/python3.4/logging/__init__.py", line 573, in format
    record.exc_text = self.formatException(record.exc_info)
  File "/usr/lib64/python3.4/logging/__init__.py", line 523, in formatException
    traceback.print_exception(ei[0], ei[1], tb, None, sio)
  File "/usr/lib64/python3.4/traceback.py", line 169, in print_exception
    for line in _format_exception_iter(etype, value, tb, limit, chain):
  File "/usr/lib64/python3.4/traceback.py", line 146, in _format_exception_iter
    for value, tb in values:
  File "/usr/lib64/python3.4/traceback.py", line 125, in _iter_chain
    context = exc.__context__
AttributeError: 'NoneType' object has no attribute '__context__'
Call stack:
  File "/root/payload/venv/bin/py.test", line 10, in <module>
    sys.exit(main())
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/config/__init__.py", line 77, in main
    return config.hook.pytest_cmdline_main(config=config)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/hooks.py", line 284, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/main.py", line 217, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/main.py", line 184, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/main.py", line 224, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/hooks.py", line 284, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/main.py", line 245, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/hooks.py", line 284, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/runner.py", line 77, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/runner.py", line 92, in runtestprotocol
    reports.append(call_and_report(item, "call", log))
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/runner.py", line 172, in call_and_report
    call = call_runtest_hook(item, when, **kwds)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/runner.py", line 196, in call_runtest_hook
    treat_keyboard_interrupt_as_exception=item.config.getvalue("usepdb"),
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/runner.py", line 212, in __init__
    self.result = func()
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/runner.py", line 194, in <lambda>
    lambda: ihook(item=item, **kwds),
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/hooks.py", line 284, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/runner.py", line 122, in pytest_runtest_call
    item.runtest()
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/python.py", line 1438, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/hooks.py", line 284, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/root/payload/venv/lib/python3.4/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/python.py", line 166, in pytest_pyfunc_call
    testfunction(**testargs)
  File "/root/payload/test/test_data_importer.py", line 68, in test_get_exception_msg
    assert data_importer._get_exception_msg("prefix", e1) == "prefix: hello world!"
  File "/root/payload/src/data_importer.py", line 55, in _get_exception_msg
    tb = logging.exception(msg)
  File "/usr/lib64/python3.4/logging/__init__.py", line 1814, in exception
    error(msg, *args, **kwargs)
  File "/usr/lib64/python3.4/logging/__init__.py", line 1805, in error
    root.error(msg, *args, **kwargs)
  File "/usr/lib64/python3.4/logging/__init__.py", line 1300, in error
    Log 'msg % args' with severity 'ERROR'.
  File "/usr/lib64/python3.4/logging/__init__.py", line 1308, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib64/python3.4/logging/__init__.py", line 1414, in _log
    self.handle(record)
  File "/usr/lib64/python3.4/logging/__init__.py", line 1424, in handle
    self.callHandlers(record)
  File "/usr/lib64/python3.4/logging/__init__.py", line 1486, in callHandlers
    hdlr.handle(record)
  File "/usr/lib64/python3.4/logging/__init__.py", line 853, in handle
    self.emit(record)
  File "/root/payload/venv/lib/python3.4/site-packages/_pytest/logging.py", line 206, in emit
    logging.StreamHandler.emit(self, record)
Message: 'prefix: hello world!'
Arguments: ()
Top level Sentry exception caught - failed creating log record
b': hello world!'
b'Traceback (most recent call last):\n  File "/root/payload/venv/lib/python3.4/site-packages/raven/handlers/logging.py", line 91, in emit\n    self.format(record)\n  File "/usr/lib64/python3.4/logging/__init__.py", line 828, in format\n    return fmt.format(record)\n  File "/usr/lib64/python3.4/logging/__init__.py", line 573, in format\n    record.exc_text = self.formatException(record.exc_info)\n  File "/usr/lib64/python3.4/logging/__init__.py", line 523, in formatException\n    traceback.print_exception(ei[0], ei[1], tb, None, sio)\n  File "/usr/lib64/python3.4/traceback.py", line 169, in print_exception\n    for line in _format_exception_iter(etype, value, tb, limit, chain):\n  File "/usr/lib64/python3.4/traceback.py", line 146, in _format_exception_iter\n    for value, tb in values:\n  File "/usr/lib64/python3.4/traceback.py", line 125, in _iter_chain\n    context = exc.__context__\nAttributeError: \'NoneType\' object has no attribute \'__context__\'\n'
@tisnik tisnik added the bug label Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant