Bug 42031 - system-activation: Search for license returns motd, communication with license server fails
system-activation: Search for license returns motd, communication with licens...
Product: UCS
Classification: Unclassified
Component: System setup
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-3-errata
Assigned To: Erik Damrose
Alexander Kläser
Depends on:
  Show dependency treegraph
Reported: 2016-08-18 16:47 CEST by Erik Damrose
Modified: 2016-09-29 17:31 CEST (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?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.514
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional):
Max CVSS v3 score:

response to GET /license (1.96 KB, text/plain)
2016-08-18 16:47 CEST, Erik Damrose

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Damrose univentionstaff 2016-08-18 16:47:20 CEST
Created attachment 7895 [details]
response to GET /license

univention-system-activation tries to load the license in order to send it to the license server:
out = subprocess.check_output(['/usr/bin/sudo', '/usr/bin/univention-ldapsearch', '-LLL', 'objectClass=univentionLicense'])

Apparently 'out' sometimes(?) also contains the output of the motd, presumably due to the sudo call. The http response to GET /license looks as in the attachment. The license server then rejects the license request.
Comment 1 Alexander Kläser univentionstaff 2016-08-19 13:25:17 CEST
AFAIS, the message of the day will be printed when sudoing due to univention-system-setup-boot being installed. I can reproduce the issue if I install u-s-s-boot and type:

  sudo /usr/bin/univention-ldapsearch -LLL objectClass=univentionLicense

I would vote for removing anything between the "/#+/"-lines, e.g. (but then with an equivalent in python):

  sudo ... | sed '/^#\+$/,/^#\+$/d; /^\s*$/d'

This seems to be the quickest solution.
Comment 2 Erik Damrose univentionstaff 2016-08-19 15:27:52 CEST
There already is a UCRv to deactivate this behaviour in setup-join.sh, but it was not set for the fast demo mode. Fixed in

r71752 univention-system-setup 9.0.4-36
r71755 yaml
r71756 Merge to 4.2

Test the sudo call with ucr set system/setup/showloginmessage=false vs. true
Comment 3 Alexander Kläser univentionstaff 2016-08-23 17:39:18 CEST
Changes: OK, loginmessage is set to false and it fixes the described problem.
Merge to 4.1-2: OK
YAML file: OK, I adjusted the description to be more user friendly [r71857]
Comment 4 Janek Walkenhorst univentionstaff 2016-08-24 12:06:45 CEST