Univention Bugzilla – Bug 50620
False positives in system diagnostics when http_proxy is used
Last modified: 2021-07-21 10:49:36 CEST
Situation: Internal DNS does not resolve external addresses. Access to internet only works through http-proxy. Running the diagnostic checks fails: univention-run-diagnostic-checks --username Administrator --bindpwdfile <(echo -n univention) -t 11_nameserver timeout resolving 'www.univention.de' with NS X.X.X.X univention-run-diagnostic-checks --username Administrator --bindpwdfile <(echo -n univention) -t 12_proxy Failed writing body (0 != 8088) (code=23) univention-run-diagnostic-checks --username Administrator --bindpwdfile <(echo -n univention) -t 23_check_update_sites {updates,appcenter}.software-univention.de are not resolvable The PROXY server does that, the host itself does not need to be able to resolve the host
TT: 2019-12-09/10
(In reply to Philipp Hahn from comment #0) > Situation: Internal DNS does not resolve external addresses. Access to > internet only works through http-proxy. > > Running the diagnostic checks fails: > univention-run-diagnostic-checks --username Administrator --bindpwdfile > <(echo -n univention) -t 12_proxy > Failed writing body (0 != 8088) (code=23) > A customer has this issue in two environments, after an update to 4.4-3 e413
TT: 2020-06-18/19 TT: 2020-05-14/15 TT: 2020-04-23/24
Added affected customers and ticket numbers I had to spend time on this issue (was not the main problem of the ticket, but had to explain the critical alert)
Same again... adding ticket.
Seems to me that 12_proxy.py does never succeed as soon as a proxy is set. I got used to tell my customers they only have to allow www.univention.de (http and https) in their proxy, but this never cured the problem. You always get the write error (23) no matter if the proxy allows access. I'd suspect the culprit to be line 53: buf = io.StringIO() which was changed from StringIO.StringIO() somewhere along the lines of Python3 preparation. According to the docs http://pycurl.io/docs/latest/callbacks.html#writefunction the write function only accepts bytes strings, while io.StringIO requires unicode. Changing line 53 to read buf = io.BytesIO() made it work.
Another major customer is affected by this.
TT: 2020-11-19/20 diff --git a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/12_proxy.py b/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/12_proxy.py index f9e823c8d2..77d4b7ba45 100644 --- a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/12_proxy.py +++ b/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/12_proxy.py @@ -50,7 +50,7 @@ def run(_umc_instance, url='http://www.univention.de/', connecttimeout=30, timeo curl.setopt(pycurl.URL, url) # curl.setopt(pycurl.VERBOSE, bVerbose) - buf = io.StringIO() + buf = io.BytesIO() curl.setopt(pycurl.WRITEFUNCTION, buf.write) MODULE.process(''.join("Trying to connect to %s via HTTP proxy %s" % (url, proxy)))
TT: 2021-02-18/19
The patch from one of the previous comments has been applied. 5.0-0: 3936c2a2a47cd20a7f9f9d028e844943dedb053a (changes) ab309682fd0c7ee244e492e008e6ac1475e42bfb (yaml) Package: univention-management-console-module-diagnostic Version: 6.0.0-13A~5.0.0.202107131648 Branch: ucs_5.0-0 Scope: errata5.0-0
OK: fix OK: code review OK: YAML
<https://errata.software-univention.de/#/?erratum=5.0x52>