Univention Bugzilla – Bug 45513
AttributeError: 'StreamReader' object has no attribute 'flush'
Last modified: 2021-02-18 07:35:26 CET
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'
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
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
Patch in fbest/45513-stream-reader-file-interface.
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
There is a abc in Python for this: io.IOBase (see https://docs.python.org/2.7/library/io.html#i-o-base-classes).
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.
<http://errata.software-univention.de/ucs/4.4/29.html>