Bug 53318 - Old schema extensions using UCR python blocks may cause the update to fail
Old schema extensions using UCR python blocks may cause the update to fail
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Update - Release updates
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Arvid Requate
https://git.knut.univention.de/univen...
: interim-7
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-21 14:27 CEST by Florian Best
Modified: 2021-05-25 16:03 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-05-21 14:27:13 CEST
Apps/Packages which bring UCR Templates or LDAP-Schema/LDAP-Extensions using Python blocks may cause the upgrade to fail by preventing a slapd start.

We should detect such cases in the preup.sh/check.sh and block the update accordingly.
A python syntax check should be done.

One example was:

Multifile: /etc/ldap/slapd.conf
  File "<stdin>", line 11
    print 'include        /usr/share/univention-ldap/schema/oxforucs-extra.schema'
                                                                                 ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('include        /usr/share/univention-ldap/schema/oxforucs-extra.schema')?
  File "<stdin>", line 18
    ''' % { 'access' : access }
      ^
SyntaxError: invalid syntax

# /etc/univention/templates/files/etc/ldap/slapd.conf.d/29univention-open-xchange_schema
@!@
import os.path
if (configRegistry.get('ldap/server/type') == "master") and configRegistry.is_false('ox/master/42/registered_ldap_acls', True):
        if not os.path.isfile("/usr/share/univention-ldap/schema/legacy/kolab2.schema"):
                print 'include        /usr/share/univention-ldap/schema/oxforucs-extra.schema'
        print 'include         /usr/share/univention-ldap/schema/oxforucs.schema'
@!@
Comment 1 Florian Best univentionstaff 2021-05-21 16:56:10 CEST
Current status in MR:
https://git.knut.univention.de/univention/ucs/-/merge_requests/100
Comment 2 Florian Best univentionstaff 2021-05-25 12:52:38 CEST
The upgrade is now blocked if Python 3 incompatible UCR template exists, which don't belong to an uninstalled package.

univention-updater (15.0.3-64)
413a18d61bdb | Bug #53318: Block update if Python 3 incompatible UCR templates exists
Comment 3 Florian Best univentionstaff 2021-05-25 16:03:11 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".