Bug 38389 - Unable to create helpdesk categories during install
Unable to create helpdesk categories during install
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Helpdesk
UCS@school 4.0
Other Linux
: P5 normal (vote)
: UCS@school 4.1 R2 v10
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
:
: 43345 (view as bug list)
Depends on:
Blocks: 43611
  Show dependency treegraph
 
Reported: 2015-04-29 15:41 CEST by Sönke Schwardt-Krummrich
Modified: 2017-03-21 12:35 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.137
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 Sönke Schwardt-Krummrich univentionstaff 2015-04-29 15:41:00 CEST
In a UCS@school singleserver test environment the helpdesk module was unable to create the LDAP object storing the helpdesk categories. The UDM module was not known to the UDM CLI which has been restarted after extracting the package.

29.04.15 14:34:51.742  MODULE      ( PROCESS ) : ucs-school-umc-helpdesk-schema (11.0.0-3.53.201504221130) wird eingerichtet ...
29.04.15 14:34:51.742  MODULE      ( PROCESS ) : ucs-school-umc-helpdesk-schema wird konfiguriert.
29.04.15 14:34:51.747  MODULE      ( PROCESS ) : ucs-school-umc-helpdesk-schema wird konfiguriert.
29.04.15 14:34:52.368  MODULE      ( PROCESS ) : Restarting ldap server(s).
29.04.15 14:34:52.422  MODULE      ( PROCESS ) : Stopping ldap server(s): slapd ...done.
29.04.15 14:34:52.567  MODULE      ( PROCESS ) : Starting ldap server(s): slapd ...done.
29.04.15 14:34:57.597  MODULE      ( PROCESS ) : Checking Schema ID: ...done.
29.04.15 14:35:02.156  MODULE      ( PROCESS ) : Multifile: /etc/ldap/slapd.conf
29.04.15 14:35:02.309  MODULE      ( PROCESS ) : Restarting ldap server(s).
29.04.15 14:35:02.404  MODULE      ( PROCESS ) : Stopping ldap server(s): slapd ...done.
29.04.15 14:35:02.550  MODULE      ( PROCESS ) : Starting ldap server(s): slapd ...done.
29.04.15 14:35:07.585  MODULE      ( PROCESS ) : Checking Schema ID: ...done.
29.04.15 14:35:07.587  MODULE      ( PROCESS ) : ucs-school-umc-helpdesk-schema installiert
29.04.15 14:35:07.591  MODULE      ( PROCESS ) : ucs-school-umc-helpdesk wird konfiguriert.
29.04.15 14:35:07.592  MODULE      ( PROCESS ) : ucs-school-umc-helpdesk (11.0.0-3.53.201504221130) wird eingerichtet ...
29.04.15 14:35:07.600  MODULE      ( PROCESS ) : ucs-school-umc-helpdesk wird konfiguriert.
29.04.15 14:35:07.608  MODULE      ( PROCESS ) : kill all running univention-cli-server
29.04.15 14:35:08.684  MODULE      ( PROCESS ) : Calling joinscript 38ucs-school-umc-helpdesk.inst ...
29.04.15 14:35:09.486  MODULE      ( PROCESS ) : 2015-04-29 14:35:09.485645625+02:00 (in joinscript_init)
29.04.15 14:35:10.447  MODULE      ( PROCESS ) : Object exists: cn=UMC,cn=univention,dc=testtestteststuff,dc=intranet
29.04.15 14:35:10.558  MODULE      ( PROCESS ) : Object exists: cn=UMC,cn=policies,dc=testtestteststuff,dc=intranet
29.04.15 14:35:10.655  MODULE      ( PROCESS ) : Object exists: cn=operations,cn=UMC,cn=univention,dc=testtestteststuff,dc=intranet
29.04.15 14:35:10.754  MODULE      ( PROCESS ) : Object exists: cn=default-umc-all,cn=UMC,cn=policies,dc=testtestteststuff,dc=intranet
29.04.15 14:35:10.862  MODULE      ( PROCESS ) : WARNING: cannot append cn=default-umc-all,cn=UMC,cn=policies,dc=testtestteststuff,dc=intranet to univentionPolicyReference, value exists
29.04.15 14:35:10.862  MODULE      ( PROCESS ) : No modification: cn=Domain Admins,cn=groups,dc=testtestteststuff,dc=intranet
29.04.15 14:35:10.959  MODULE      ( PROCESS ) : Object exists: cn=default-umc-users,cn=UMC,cn=policies,dc=testtestteststuff,dc=intranet
29.04.15 14:35:11.067  MODULE      ( PROCESS ) : WARNING: cannot append cn=default-umc-users,cn=UMC,cn=policies,dc=testtestteststuff,dc=intranet to univentionPolicyReference, value exists
29.04.15 14:35:11.067  MODULE      ( PROCESS ) : No modification: cn=Domain Users,cn=groups,dc=testtestteststuff,dc=intranet
29.04.15 14:35:11.175  MODULE      ( PROCESS ) : Object created: cn=helpdesk-all,cn=operations,cn=UMC,cn=univention,dc=testtestteststuff,dc=intranet
29.04.15 14:35:11.287  MODULE      ( PROCESS ) : Object created: cn=config,cn=UMC,cn=univention,dc=testtestteststuff,dc=intranet
29.04.15 14:35:11.711  MODULE      ( PROCESS ) : unknown module settings/console_helpdesk.
29.04.15 14:35:11.711  MODULE      ( PROCESS ) : 
29.04.15 14:35:11.711  MODULE      ( PROCESS ) : Available Modules are:
29.04.15 14:35:11.712  MODULE      ( PROCESS ) : appcenter/app
29.04.15 14:35:11.712  MODULE      ( PROCESS ) : computers/computer
29.04.15 14:35:11.712  MODULE      ( PROCESS ) : computers/domaincontroller_backup
29.04.15 14:35:11.712  MODULE      ( PROCESS ) : computers/domaincontroller_master
29.04.15 14:35:11.712  MODULE      ( PROCESS ) : computers/domaincontroller_slave


Maybe it's a timing issue. From ucs-school-umc-helpdesk.postinst:
---[cut]---
stop_udm_cli_server
#DEBHELPER#
---[cut]---
So if the UDM server is restarted by a background task before the DEBHELPER/python-support has finished its tasks, the UDM module may be still unknown.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2015-04-29 22:14:23 CEST
Sidenote: other systems had no problems.
Comment 2 Florian Best univentionstaff 2015-05-19 16:05:41 CEST
Is the joinscript then marked as successfully executed?
Comment 3 Florian Best univentionstaff 2017-01-16 15:59:11 CET
*** Bug 43345 has been marked as a duplicate of this bug. ***
Comment 4 Daniel Tröder univentionstaff 2017-02-20 14:08:48 CET
The problem seems not to have been resurfaced in almost 2 years. The implemented "fix" is to let the join script fail, if the category creation fails. The join script can then be run again.

r76877: let join script fail completely if any of its parts fails

Package: ucs-school-umc-helpdesk
Version: 12.0.3-2.58.201702201406
Branch: ucs_4.1-0
Scope: ucs-school-4.1r2
Comment 5 Florian Best univentionstaff 2017-02-20 14:11:15 CET
Hm? This happened to me just some days ago when I set up my UCS@school 4.2 system. Letting the joinscript fail is not a solution because this will hit the users in the school configuration wizard.
Comment 6 Florian Best univentionstaff 2017-02-20 14:13:25 CET
Maybe this happens only on a singlemaster?
Comment 7 Daniel Tröder univentionstaff 2017-02-21 10:36:28 CET
76897: changed order in postfix
Comment 8 Florian Best univentionstaff 2017-02-21 10:51:52 CET
Can you explain this further?
Comment 9 Daniel Tröder univentionstaff 2017-02-22 14:40:04 CET
(In reply to Daniel Tröder from comment #7)
> 76897: changed order in postfix
s/postfix/postinst/

(In reply to Florian Best from comment #8)
> Can you explain this further?
The Debian Python helper creates the compiled python modules. Only after that the new python (UDM) modules are known to the system.
Comment 10 Sönke Schwardt-Krummrich univentionstaff 2017-03-17 14:34:35 CET
The resulting postinst looks like this after #DEBHELPER# has been replaced:

. /usr/share/univention-lib/base.sh
# run join script on DC master and DC backup
. /usr/share/univention-lib/base.sh
call_joinscript 38ucs-school-umc-helpdesk.inst || true
invoke-rc.d univention-management-console-server reload || true
# generate a new hash for the UMC frontend in order to avoid caching problems
. /usr/share/univention-lib/umc.sh
umc_frontend_new_hash
# Automatically added by dh_pysupport
if which update-python-modules >/dev/null 2>&1; then
        update-python-modules  ucs-school-umc-helpdesk.public
fi
# End automatically added section
echo "kill all running univention-cli-server"
stop_udm_cli_server
exit 0

The problem here is, that the order of commands is completely wrong but cannot be corrected due to autogenerated code via DEBHELPER:
- call update-python-modules to install/symlink new UDM modules
- kill UDM CLI server to activate new UDM modules
- call join script that uses new UDM modules

It seems to work if (after extracting ucs-school-umc-helpdesk) another postinst script is called that also calls update-python-modules.
If this is not the case, creating the helpdesk categories via the UDM module fails because it's unknown to the running UDM CLI server.

Workaround: 
call the joinscript again → the first execution will probably fail but the second one should show no problem:

--- a/ucs-school-4.1r2/ucs-school-umc-helpdesk/debian/ucs-school-umc-helpdesk.postinst
+++ b/ucs-school-4.1r2/ucs-school-umc-helpdesk/debian/ucs-school-umc-helpdesk.postinst
@@ -37,5 +37,7 @@
 echo "kill all running univention-cli-server"
 stop_udm_cli_server
 
+# Bug #38389: call joinscript again even if DEBHELPER has called it before
+call_joinscript 38ucs-school-umc-helpdesk.inst || true
 
 exit 0
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2017-03-17 14:35:24 CET
Please merge changes also to UCS@school 4.2 and create a separate bug for it with TargetMilestone U@S 4.2
Comment 12 Daniel Tröder univentionstaff 2017-03-17 15:19:24 CET
r77897: workaround DEBHELPER order by calling join script a second time
Comment 13 Sönke Schwardt-Krummrich univentionstaff 2017-03-17 16:14:50 CET
OK: code change
OK: functional tests
OK: advisory
Comment 14 Sönke Schwardt-Krummrich univentionstaff 2017-03-21 12:35:57 CET
UCS@school 4.1 R2 v10 has been released.

http://docs.software-univention.de/changelog-ucsschool-4.1R2v10-de.html

If this error occurs again, please clone this bug.