Skip to content

Mitogen issues in AWX when used verbosity 3 and higher #400

Closed
@Houbovo

Description

@Houbovo

Mitogen is configured to be used in AWX. Version of mitogen: 0.2.2, AWX: 2.0.0
When used verbosity 0 (Normal), 1 (Verbose) or 2 (More verbose) everything works as expected.
When used verbosity 3 (Debug), or 4 (Connection Debug) template runs "forever" with output

[pid 1498] 13:56:51.875998 D mitogen: unix.connect(path='/tmp/mitogen_unix_ahHeVg')
Exception in thread mitogen-broker:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner  self.run()
  File "/usr/lib64/python2.7/threading.py", line 765, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/var/lib/awx/projects/_8__git_onecloud/strategy_plugins/mitogen/core.py", line 340, in <lambda>
    _profile_hook = lambda name, func, *args: func(*args)
  File "/var/lib/awx/projects/_8__git_onecloud/strategy_plugins/mitogen/core.py", line 1813, in _broker_main
    LOG.exception('_broker_main() crashed')
  File "/usr/lib64/python2.7/logging/__init__.py", line 1182, in exception
    self.error(msg, *args, **kwargs)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1175, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1268, in _log
    self.handle(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1278, in handle
    self.callHandlers(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1318, in callHandlers
    hdlr.handle(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 749, in handle
    self.emit(record)
  File "/var/lib/awx/projects/_8__git_onecloud/strategy_plugins/ansible_mitogen/logging.py", line 70, in emit
    display.error(s, wrap_text=False)
  File "/usr/lib/python2.7/site-packages/awx/lib/awx_display_callback/display.py", line 40, in wrapper
    with event_context.set_local(**context):
  File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/lib/python2.7/site-packages/awx/lib/awx_display_callback/events.py", line 96, in set_local
    self.remove_local(**kwargs)
  File "/usr/lib/python2.7/site-packages/awx/lib/awx_display_callback/events.py", line 88, in remove_local
    self._local._ctx.pop(key, None)
AttributeError: 'thread._local' object has no attribute '_ctx' 

Steps to reproduce:

  1. Install AWX, mitogen, put mitogen in strategy_plugins (everything standard installation)
  2. Create some template in AWX
  3. Run the template in AWX with desired verbosity

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions