Bug 43324 - restore_data_before_setup restores slightly broken UCR variables
restore_data_before_setup restores slightly broken UCR variables
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-4-errata
Assigned To: Dirk Wiesenthal
Felix Botner
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-10 23:24 CET by Dirk Wiesenthal
Modified: 2017-01-18 13:58 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.086
Enterprise Customer affected?:
School Customer affected?:
ISV affected?: Yes
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 Dirk Wiesenthal univentionstaff 2017-01-10 23:24:36 CET
From the logs:
** Restore normal UCR layer:
[..., 'domainname= nosamba.intranet', 'gateway= 172.17.42.1', ...]


The script adds one leading space to each and every value.

Interestingly, this is barely noticeable. Many services still work.

When fixing this, I feel we should extend the BLACKLIST of UCRVs not copied by those set by the App Center itself (ldap/*, repository/app_center_server', ...).
Comment 1 Dirk Wiesenthal univentionstaff 2017-01-10 23:31:33 CET
(In reply to Dirk Wiesenthal from comment #0)
> When fixing this, I feel we should extend the BLACKLIST of UCRVs not copied
> by those set by the App Center itself (ldap/*,
> repository/app_center_server', ...).

This may not be a good idea as we then need to keep those lists in sync.
Comment 2 Florian Best univentionstaff 2017-01-11 01:40:22 CET
I don't understand the problem, can you explain again?
Comment 3 Dirk Wiesenthal univentionstaff 2017-01-11 01:43:30 CET
The problem is that when exchanging an appbox container, UCR is first dumped into a backup file and then restored. This second phase is buggy as it reads the backup base.conf and splits on ':' rather than ': '. Thus, the stored value gets an additional ' ' when restored, leading to
  ucr set 'domainname= nosamba.intranet'
Comment 4 Florian Best univentionstaff 2017-01-11 01:49:10 CET
Ah okay. Why do you parse UCR by yourself? That's not good, even if you know to split at ': ' (which was obviously not done :D) there can also be issues with encodings.
Can't you ucr.load(); json.dumps(dict(ucr)) for the backup?
Comment 5 Dirk Wiesenthal univentionstaff 2017-01-17 14:26:19 CET
Fixed in
  univention-docker-container-mode 1.0.14-8.69.201701171421

(In reply to Florian Best from comment #4)
> Ah okay. Why do you parse UCR by yourself?
Using native UCR functions would be better, yes. But this fix is far less complicated when changing only the erroneous split().
Comment 6 Felix Botner univentionstaff 2017-01-17 15:13:11 CET
OK - restore_data_before_setup in container 
OK - merged to 4.2-0
OK - YAML
Comment 7 Janek Walkenhorst univentionstaff 2017-01-18 13:58:25 CET
<http://errata.software-univention.de/ucs/4.1/378.html>