Bug 45513 - AttributeError: 'StreamReader' object has no attribute 'flush'
AttributeError: 'StreamReader' object has no attribute 'flush'
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.4-0-errata
Assigned To: Florian Best
Dirk Wiesenthal
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-12 18:21 CEST by Florian Best
Modified: 2021-02-18 07:35 CET (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.257
Enterprise Customer affected?:
School Customer affected?:
ISV affected?: Yes
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2018111721000527, 2018121121000367, 2017101221000745, 2019031521001016
Bug group (optional): Cleanup, External feedback
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2017-10-12 18:21:41 CEST
Version: 4.2-1 errata52 (Lesum)

Remark: cloned machine
clone started with new ip
tried to install docker app

Execution of command 'appcenter/docker/progress' has failed:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 249, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/mixins.py", line 149, in progress
    ret = progress_obj.poll()
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 309, in _thread
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 417, in invoke_docker
    result['success'] = action.call(app=app, username=self.username, password=self.password, **kwargs)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 239, in call
    return obj.call_with_namespace(namespace)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 245, in call_with_namespace
    result = self.main(namespace)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 70, in main
    return self.do_it(args)
  File "%PY2.7%/univention/appcenter/actions/install_base.py", line 126, in do_it
    self._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/docker_install.py", line 65, in _do_it
    ret = super(Install, self)._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 85, in _do_it
    self._register_attributes(app, args)
  File "%PY2.7%/univention/appcenter/actions/register.py", line 220, in _register_attributes
    if not schema_obj.wait_for_activation():
  File "%PY2.7%/univention/lib/ldap_extension.py", line 83, in wait_for_activation
    sys.stdout.flush()
AttributeError: 'StreamReader' object has no attribute 'flush'
Comment 1 Johannes Keiser univentionstaff 2018-12-19 13:34:23 CET
Reported again: Version: 4.3-2 errata376 (Neustadt)

Internal server error during "appcenter/docker/progress".
Request: appcenter/docker/progress

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 253, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/mixins.py", line 149, in progress
    ret = progress_obj.poll()
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 309, in _thread
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 431, in invoke_docker
    result['success'] = action.call(app=app, username=self.username, password=self.password, **kwargs)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 220, in call
    return obj.call_with_namespace(namespace)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 226, in call_with_namespace
    result = self.main(namespace)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 73, in main
    return self.do_it(args)
  File "%PY2.7%/univention/appcenter/actions/install_base.py", line 109, in do_it
    self._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/docker_install.py", line 63, in _do_it
    ret = super(Install, self)._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 88, in _do_it
    self._register_attributes(app, args)
  File "%PY2.7%/univention/appcenter/actions/register.py", line 225, in _register_attributes
    if not schema_obj.wait_for_activation():
  File "%PY2.7%/univention/lib/ldap_extension.py", line 116, in wait_for_activation
    sys.stdout.flush()
AttributeError: 'StreamReader' object has no attribute 'flush'

Role: domaincontroller_master
Comment 2 Johannes Keiser univentionstaff 2019-01-31 18:07:47 CET
Reported again: Version: 4.3-2 errata313 (Neustadt)

Internal server error during "appcenter/docker/progress".
Request: appcenter/docker/progress

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 253, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/mixins.py", line 149, in progress
    ret = progress_obj.poll()
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 309, in _thread
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 431, in invoke_docker
    result['success'] = action.call(app=app, username=self.username, password=self.password, **kwargs)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 220, in call
    return obj.call_with_namespace(namespace)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 226, in call_with_namespace
    result = self.main(namespace)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 73, in main
    return self.do_it(args)
  File "%PY2.7%/univention/appcenter/actions/install_base.py", line 109, in do_it
    self._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/docker_install.py", line 63, in _do_it
    ret = super(Install, self)._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 88, in _do_it
    self._register_attributes(app, args)
  File "%PY2.7%/univention/appcenter/actions/register.py", line 225, in _register_attributes
    if not schema_obj.wait_for_activation():
  File "%PY2.7%/univention/lib/ldap_extension.py", line 115, in wait_for_activation
    sys.stdout.flush()
AttributeError: 'StreamReader' object has no attribute 'flush'

Role: domaincontroller_master
Comment 3 Florian Best univentionstaff 2019-03-15 17:09:17 CET
Patch in fbest/45513-stream-reader-file-interface.
Comment 4 Florian Best univentionstaff 2019-03-20 12:42:06 CET
Patch applied.

univention-appcenter (8.0.11-6)
00801f65db7e | Bug #45513: add flush() to StreamReader to fulfill least file interface

univention-appcenter.yaml
195d98f934cb | YAML Bug #45513
00801f65db7e | Bug #45513: add flush() to StreamReader to fulfill least file interface
Comment 5 Daniel Tröder univentionstaff 2019-03-20 14:59:14 CET
There is a abc in Python for this: io.IOBase (see https://docs.python.org/2.7/library/io.html#i-o-base-classes).
Comment 6 Dirk Wiesenthal univentionstaff 2019-03-26 23:21:28 CET
OK, works.

It seems to be an issue with parallel tasks in UMC. One did catch_stdout() (used in "univention-app update" for example) and the other one registered the attribute (as in "univention-app install"). If two such requests were handled by the same session, this could happen.
Comment 7 Arvid Requate univentionstaff 2019-03-27 13:29:19 CET
<http://errata.software-univention.de/ucs/4.4/29.html>