Univention Bugzilla – Bug 55726
UCRV umc/http/processes is set and apache.service dont start since update to UCS 5.0-3
Last modified: 2023-02-23 19:36:14 CET
UCS Version 5.0-3 if the UCR variable umc/http/processes is set, after upgrading to UCS 5.0-3, Apache no longer works because "ucr commit" cannot generate the file /etc/apache2/sites-available/univention.conf file correctly. This is not noticeable at first during the upgrade, there is no error due to univention-upgrade! Apache said: root@test:~# systemctl status apache2.service ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2023-02-18 13:08:21 CET; 9s ago Docs: https://httpd.apache.org/docs/2.4/ Process: 14095 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE) Feb 18 13:08:21 test systemd[1]: Starting The Apache HTTP Server... Feb 18 13:08:21 test apachectl[14095]: apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 44 of /etc/apache2/sites-enabled/univention.conf: /etc/apache2/sites-enabled/univention.conf:44: <Proxy> was not closed. Feb 18 13:08:21 test apachectl[14095]: Action 'start' failed. The error at ucr commit (also occurs frequently in updater.log): root@test:~# ucr commit /etc/apache2/sites-available/univention.conf File: /etc/apache2/sites-available/univention.conf Traceback (most recent call last): File "<stdin>", line 14, in <module> TypeError: unsupported operand type(s) for +: 'int' and 'str'
To which value are the UCR variables umc/http/* set to?
Proposal for a fix --- management/univention-management-console/conffiles/etc/apache2/sites-available/univention.conf +++ management/univention-management-console/conffiles/etc/apache2/sites-available/univention.conf @@ -89,7 +89,7 @@ print('\tHeader always setifempty "Content-Security-Policy" "%s"' % (csp,)) @!@ if int(configRegistry.get('umc/http/processes', 1)) > 1: - start_port = configRegistry.get('umc/http/processes/start-port', 18200) + start_port = int(configRegistry.get('umc/http/processes/start-port', 18200)) interface = configRegistry.get('umc/http/interface', '127.0.0.1') print('Header add Set-Cookie "UMCWEB_ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED') print('<Proxy "balancer://umcwebcluster">')
(In reply to Erik Damrose from comment #2) > To which value are the UCR variables umc/http/* set to? this doesn't matter as the traceback is about the second @!@ hunk. it is kind of broken since beginning in git:336b258c5a38654ea85510079eda76570ad05a0f: > 92 start_port = int(configRegistry.get('umc/http/processes/start-port', 18200)) … > 97 print('\tBalancerMember "http://%s:%d" route=%s retry=0 timeout=%d' % (interface, i + start_port, i + 1, int(configRegistry.get('umc/http/response-timeout', '310 ')) + 1)) → no cast to int is done. Since git:27e041f043fe956fde72c6e992062177e9d4acfd the default value is added in the UCR definition which causes this.
I asked the customer and this value was set like in our doc 16 CPU cores: umc/http/processes=15 and umc/server/processes=15 https://docs.software-univention.de/ext-performance/5.0/en/#vertical-performance-scaling
The UCR template has been fixed: univention-management-console.yaml 6c4f55bd83ee | fix(umc): fix UCR template when (default) value is set univention-management-console (12.0.17-4) 6c4f55bd83ee | fix(umc): fix UCR template when (default) value is set
[Bug#20933](https://forge.univention.org/bugzilla/show_bug.cgi?id=20933) added the `get_int()` API to UCS 5.0-0: ```diff - start_port = int(configRegistry.get('umc/http/processes/start-port', 18200)) + start_port = configRegistry.get_int('umc/http/processes/start-port', 18200) ```
OK: Patch applied, fixes the issue. OK~ I think we do not need the change the code further, as suggested OK: univention-management-console 12.0.17-4A~5.0.0.202302201440 OK: yaml Verified
<https://errata.software-univention.de/#/?erratum=5.0x583>