Bug 43674 - runlevel links are not created for seconds, third, ... docker app - containers not started after reboot
runlevel links are not created for seconds, third, ... docker app - containe...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Docker
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2
Assigned To: Stefan Gohmann
Felix Botner
: interim-3
Depends on: 43338
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-01 03:38 CET by Dirk Wiesenthal
Modified: 2017-04-04 18:28 CEST (History)
3 users (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 Dirk Wiesenthal univentionstaff 2017-03-01 03:38:28 CET
We create services for every Docker App via
  update-rc.d

This fails in 4.2. Presumably because of systemd.

+++ This bug was initially created as a clone of Bug #43338 +++

The Docker App installation fails in UCS 4.2 for example the test case 80_docker/51_app_install.

root@master221:~# univention-app install --noninteractive --username=Administrator --pwdfile=/var/lib/ucs-test/pwdfile l35s4yeh3n=7.5.6
Going to install l35s4yeh3n (7.5.6)
Creating data directories for l35s4yeh3n...
Registering UCR for l35s4yeh3n
Marking l35s4yeh3n=7.5.6 as installed
File: /etc/univention/service.info/services/univention-appcenter.cfg
Creating /etc/init.d/docker-app-l35s4yeh3n
Adding localhost to LDAP object
Reloading apache2 configuration (via systemctl): apache2.service.
Registering the container host l35s4-06428204 for l35s4yeh3n
Verifying Docker registry manifest for app image docker.software-univention.de/ucs-appbox-amd64:4.1-0
Downloading app image docker.software-univention.de/ucs-appbox-amd64:4.1-0
4.1-0: Pulling from docker.software-univention.de/ucs-appbox-amd64
11dfab8a205f: Already exists
1d13bc13f3d7: Already exists
15697233729e: Already exists
97bcad21930f: Already exists
Digest: sha256:01902de8e5cfb228508990df468a4d746f29e390a55e73ab5e495100b56b16fa
Status: Image is up to date for docker.software-univention.de/ucs-appbox-amd64:4.1-0
Initializing app image
Preconfiguring container b8afb6a571ef5e5ff3c2cd13b2a86048e2325420d74ff21f119e896901a8c101
Starting l35s4yeh3n Container b8afb6a571ef5e5ff3c2cd13b2a86048e2325420d74ff21f119e896901a8c101 ....
Going to remove l35s4yeh3n (7.5.6)
b8afb6a571ef5e5ff3c2cd13b2a86048e2325420d74ff21f119e896901a8c101
b8afb6a571ef5e5ff3c2cd13b2a86048e2325420d74ff21f119e896901a8c101
Removing localhost from LDAP object
File: /etc/univention/service.info/services/univention-appcenter.cfg
Reloading apache2 configuration (via systemctl): apache2.service.
Error sending app infos to the App Center server: HTTP Error 404: Not Found
[Errno 2] No such file or directory: '/var/lib/docker/overlay/b8afb6a571ef5e5ff3c2cd13b2a86048e2325420d74ff21f119e896901a8c101/merged/etc/machine.secret'
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/__init__.py", line 191, in call_with_namespace
    result = self.main(namespace)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/install.py", line 67, in main
    return self.do_it(args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/install_base.py", line 109, in do_it
    self._do_it(app, args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/docker_install.py", line 65, in _do_it
    ret = super(Install, self)._do_it(app, args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/install.py", line 82, in _do_it
    if self._install_app(app, args):
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/docker_install.py", line 59, in _install_app
    self._start_docker_image(app, hostdn, password, args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/docker_base.py", line 206, in _start_docker_image
    with open(docker.path('/etc/machine.secret'), 'w+b') as f:
IOError: [Errno 2] No such file or directory: '/var/lib/docker/overlay/b8afb6a571ef5e5ff3c2cd13b2a86048e2325420d74ff21f119e896901a8c101/merged/etc/machine.secret'
Traceback (most recent call last):
  File "/usr/bin/univention-app", line 90, in <module>
    main()
  File "/usr/bin/univention-app", line 77, in main
    ret = args.func(args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/__init__.py", line 191, in call_with_namespace
    result = self.main(namespace)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/install.py", line 67, in main
    return self.do_it(args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/install_base.py", line 109, in do_it
    self._do_it(app, args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/docker_install.py", line 65, in _do_it
    ret = super(Install, self)._do_it(app, args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/install.py", line 82, in _do_it
    if self._install_app(app, args):
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/docker_install.py", line 59, in _install_app
    self._start_docker_image(app, hostdn, password, args)
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/docker_base.py", line 206, in _start_docker_image
    with open(docker.path('/etc/machine.secret'), 'w+b') as f:
IOError: [Errno 2] No such file or directory: '/var/lib/docker/overlay/b8afb6a571ef5e5ff3c2cd13b2a86048e2325420d74ff21f119e896901a8c101/merged/etc/machine.secret'
Comment 1 Felix Botner univentionstaff 2017-03-01 11:57:55 CET
Also, the docker init scripts seems to be broken

wordpress app already installed
-> univention-app install etherpad-lite
...
insserv: script docker-app-etherpad-lite: service App1_Container already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header

...

-> update-rc.d docker-app-etherpad-lite defaults 41 14
insserv: warning: script 'K01univention-system-setup-boot' missing LSB tags and overrides
insserv: script docker-app-etherpad-lite: service App1_Container already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header


-> ls -la /etc/rc2.d/*docker*
lrwxrwxrwx 1 root root 16 Feb 27 12:36 /etc/rc2.d/S03docker -> ../init.d/docker
lrwxrwxrwx 1 root root 30 Feb 27 12:50 /etc/rc2.d/S04docker-app-wordpress -> ../init.d/docker-app-wordpress


seems that the links in the runlevels are missing.

And now, after a reboot only one docker app is started!
Comment 2 Stefan Gohmann univentionstaff 2017-03-10 07:49:05 CET
univention-appcenter

r77558:

* The provided service in the docker init scripts needs to be unique.
  Previously, the init script was just a link to a generic init script
  and all init scripts provide the same service. The generic init
  script is now copied during the installation of an app and the
  string @%@APPID@%@ is replaced with the app id. This is also done
  during the upgrade (Bug #43674)
Comment 3 Stefan Gohmann univentionstaff 2017-03-10 10:32:21 CET
Changelog: r77559

My tests were successful.
Comment 4 Felix Botner univentionstaff 2017-03-13 19:07:12 CET
OK - update/installation in 4.2

init.d
ls -al /etc/init.d/docker-app-*
-rwxr-xr-x 1 root root 7547 Mär 13 18:50 /etc/init.d/docker-app-dudle
-rwxr-xr-x 1 root root 7571 Mär 13 14:39 /etc/init.d/docker-app-etherpad-lite
-rwxr-xr-x 1 root root 7547 Mär 13 14:39 /etc/init.d/docker-app-horde

runlevel 2
ls -la /etc/rc2.d/S04dock*
lrwxrwxrwx 1 root root 26 Mär 13 18:50 /etc/rc2.d/S04docker-app-dudle -> ../init.d/docker-app-dudle
lrwxrwxrwx 1 root root 34 Mär 13 14:36 /etc/rc2.d/S04docker-app-etherpad-lite -> ../init.d/docker-app-etherpad-lite
lrwxrwxrwx 1 root root 26 Mär 13 14:39 /etc/rc2.d/S04docker-app-horde -> ../init.d/docker-app-horde


 ls -la /etc/rc6.d/K01docker-app-*
lrwxrwxrwx 1 root root 26 Mär 13 18:50 /etc/rc6.d/K01docker-app-dudle -> ../init.d/docker-app-dudle
lrwxrwxrwx 1 root root 34 Mär 13 14:20 /etc/rc6.d/K01docker-app-etherpad-lite -> ../init.d/docker-app-etherpad-lite
lrwxrwxrwx 1 root root 26 Mär 13 14:20 /etc/rc6.d/K01docker-app-horde -> ../init.d/docker-app-horde

all apps started after reboot

OK - changelog
Comment 5 Stefan Gohmann univentionstaff 2017-04-04 18:28:40 CEST
UCS 4.2 has been released:
 https://docs.software-univention.de/release-notes-4.2-0-en.html
 https://docs.software-univention.de/release-notes-4.2-0-de.html

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