Bug 39462 - Copy join status while performing a container upgrade
Copy join status while performing a container upgrade
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Docker
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1
Assigned To: Stefan Gohmann
Felix Botner
: interim-2
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-02 17:00 CEST by Stefan Gohmann
Modified: 2015-11-17 12:12 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
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 Stefan Gohmann univentionstaff 2015-10-02 17:00:04 CEST
See also Bug #39204

The default store data scripts should copy the join status, e.g.
 - parts of /etc/univention/base*conf
 - /etc/*secret
 - /var/univention-join/*
 - /var/lib/univention-ldap/
 - /var/lib/univention-directory-listener/
 - ...
Comment 1 Stefan Gohmann univentionstaff 2015-10-17 22:20:29 CEST
I've updated store_data and restore_data_before_setup (r64563). Some files are now copied, I guess we need copy some more. 

The UCR variables are complete restored expect a blacklist like version/*.
Comment 2 Felix Botner univentionstaff 2015-10-20 10:40:32 CEST
-> /usr/share/ucs-test/runner python -f /usr/share/ucs-test/80_docker/78_app_ports_conflicts_redirect

univention-app install --noninteractive --username=Administrator --pwdfile=/var/lib/ucs-test/pwdfile app
Going to install app (6.1.3)
Creating data directories for app...
Registering UCR for app
Marking app=6.1.3 as installed
File: /etc/univention/service.info/services/univention-appcenter.cfg
Creating /etc/init.d/docker-app-app
Multifile: /etc/apache2/sites-available/default-ssl
Multifile: /etc/apache2/sites-available/default
Adding localhost to LDAP object
Multifile: /etc/apache2/sites-available/default-ssl
Multifile: /etc/apache2/sites-available/default
Reloading web server config: apache2.
Creating data directories for app...
Registering the container host app-1445329878155843 for app
Downloading app image docker.software-univention.de/ucs-appbox-amd64:4.1-0. This may take several minutes
4.1-0: Pulling from docker.software-univention.de/ucs-appbox-amd64
b7899339a230: Already exists
8ef51e30e75f: Already exists
5e05c3b7fdba: Already exists
bb89f467f5a5: Already exists
bb89f467f5a5: Already exists
Digest: sha256:f1109923b9c883d6f65c05f17effc2ebc49ee8af7c5d55278265051280c9e80e
Status: Image is up to date for docker.software-univention.de/ucs-appbox-amd64:4.1-0
Verifying app image docker.software-univention.de/ucs-appbox-amd64:4.1-0
Initializing app image
Preconfiguring container c0e3470c4284a861632e5b71a7ec99cfd4ca5c375fb403c7e7096e49072b1c62
Starting app Container c0e3470c4284a861632e5b71a7ec99cfd4ca5c375fb403c7e7096e49072b1c62 ....
/usr/sbin/ucr
Setting registry variables for app
Setting update/secure_apt
Create repository/app_center/server
Setting server/role
Setting repository/online/server
Create updater/identify
Create ldap/master
Create nameserver/external
Create locale/default
Setting nameserver2
Setting nameserver1
Setting domainname
Create ldap/hostdn
Setting locale
Setting nameserver/option/timeout
Setting ldap/master/port
Create update/warning/releasenotes
File: /etc/welcome.msg
Multifile: /etc/postfix/ldap.virtualwithcanonical
File: /etc/default/locale
File: /etc/issue
Multifile: /etc/hosts
Multifile: /etc/postfix/ldap.virtual
File: /etc/libnss-ldap.conf
File: /etc/locale.gen
Generating locales (this might take a while)...
  de_DE.UTF-8... done
  en_US.UTF-8... done
Generation complete.
File: /etc/cron.d/univention-directory-policy
File: /etc/default/ntpdate
Multifile: /etc/postfix/main.cf
File: /usr/share/univention-management-console/modules/setup-certificate.xml
Multifile: /etc/postfix/ldap.saslusermapping
File: /etc/apt/sources.list.d/20_ucs-online-component.list
File: /etc/ntp.conf
File: /etc/pam.d/smtp
File: /etc/pam_ldap.conf
File: /etc/krb5.conf
File: /etc/resolv.conf
File: /etc/issue.net
File: /etc/apt/apt.conf.d/20secureapt
File: /etc/dhcp/dhclient.conf
Multifile: /etc/postfix/ldap.canonicalsender
Multifile: /etc/postfix/ldap.canonicalrecipient
Multifile: /etc/postfix/ldap.transport
File: /etc/apt/apt.conf.d/55user_agent
File: /etc/apt/sources.list.d/15_ucs-online-version.list
Multifile: /etc/postfix/ldap.virtualdomains
Multifile: /etc/postfix/ldap.distlist
Multifile: /etc/postfix/ldap.groups
Multifile: /etc/postfix/ldap.sharedfolderlocal
File: /etc/mailname
File: /etc/profile
Multifile: /etc/postfix/ldap.sharedfolderremote
File: /etc/runit/univention-directory-listener/run
File: /etc/apt/mirror.list
Executing interface restore_data_before_setup for app
** Restore forced UCR layer:
Traceback (most recent call last):
  File "/usr/share/univention-docker-container-mode/restore_data_before_setup", line 100, in <module>
    restore_ucr_layer(os.path.join(conf_dir, 'base-forced.conf'), {'force': True})
  File "/usr/share/univention-docker-container-mode/restore_data_before_setup", line 74, in restore_ucr_layer
    f = open(ucr_file, "r")
IOError: [Errno 2] No such file or directory: '/var/lib/univention-appcenter/apps/app/conf/base-forced.conf'
Executing interface setup for app

Maybe check if ucr_file exists in restore_ucr_layer() in /usr/share/univention-docker-container-mode/restore_data_before_setup?
Comment 3 Stefan Gohmann univentionstaff 2015-10-23 09:30:23 CEST
The first version has been added. I've also added a test case:
 80_docker/64_app_container_upgrade
Comment 4 Felix Botner univentionstaff 2015-10-29 15:20:24 CET
FAIL - store_data destroys links

OK - test
OK - upgrade (install -> store_data -> upgrade -> restore_data_before_setup -> store_data)
Comment 5 Stefan Gohmann univentionstaff 2015-10-30 11:36:50 CET
(In reply to Felix Botner from comment #4)
> FAIL - store_data destroys links

Fixed in univention-docker-container-mode: r64998 + r65002

I've also improved the test case: r64997
Comment 6 Felix Botner univentionstaff 2015-11-02 16:10:10 CET
OK
Comment 7 Stefan Gohmann univentionstaff 2015-11-17 12:12:01 CET
UCS 4.1 has been released:
 https://docs.software-univention.de/release-notes-4.1-0-en.html
 https://docs.software-univention.de/release-notes-4.1-0-de.html

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