Bug 50034 - rename REST API package into univention-directory-manager-rest
rename REST API package into univention-directory-manager-rest
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 4.2
Other Linux
: P3 enhancement (vote)
: UCS 4.4-1-errata
Assigned To: Florian Best
Felix Botner
:
Depends on:
Blocks: 50171
  Show dependency treegraph
 
Reported: 2019-08-20 20:28 CEST by Florian Best
Modified: 2019-09-22 15:51 CEST (History)
10 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 Florian Best univentionstaff 2019-08-20 20:28:57 CEST
+++ This bug was initially created as a clone of Bug #27816 +++
Comment 1 Florian Best univentionstaff 2019-08-20 20:32:46 CEST
Added the dependencies to the meta packages for DC Master and DC Backup:

univention-server.yaml
d048dde30e12 | Bug #50034: install REST service on DC Master and DC Backup by default

univention-server (14.0.0-7)
d048dde30e12 | Bug #50034: install REST service on DC Master and DC Backup by default
Comment 2 Erik Damrose univentionstaff 2019-08-22 18:05:12 CEST
OK: Packages are installed on DC Master and DC Backup
OK: Service definition works, service gets started on UCS update, and runs after a reboot.

~~: Should we install and start the api server by default? We are releasing this as an erratum.

Reopen: I think the component naming is very confusing. The source package is univention-management-console-module-udm. The HTTP API is released in the binary package univention-management-module-udm. It deploys and spawns a service with the same name. But the python process is called univention.management.server - this may get confused with univention-management-console-server... And additionally, the logfile is called management-module-udm.log

The service definition in univention-management-module-udm.service looks like work in progress, with various lines commented out. I also do not understand why the service is started via bash, then 'exec's a python process, whose output is redirected to the logfile, when there are also the service config options StandardOutput= and StandardError=

Also, the yaml files contain ONLY this bug. That is very dangerous. If i would set this bug to verified, the packages would be cleared to be released. I will add bug 27816 to the yaml files for now.

In a quick test i could not deactivate the service via UCR, i will have to check again - it might not be an issue with this package.
Comment 3 Florian Best univentionstaff 2019-08-22 18:29:31 CEST
(In reply to Erik Damrose from comment #2)
> OK: Packages are installed on DC Master and DC Backup
> OK: Service definition works, service gets started on UCS update, and runs
> after a reboot.
> 
> ~~: Should we install and start the api server by default? We are releasing
> this as an erratum.
That was Ingo's decision, yes.

> Reopen: I think the component naming is very confusing. The source package
> is univention-management-console-module-udm. The HTTP API is released in the
> binary package univention-management-module-udm. It deploys and spawns a
> service with the same name. But the python process is called
> univention.management.server - this may get confused with
> univention-management-console-server... And additionally, the logfile is
> called management-module-udm.log
I know. I am open for enhancing this and finding a nice naming scheme.
We are probably able to rename the package in this state, as it is not yet really released.
The old package can be kept with a dependency and a note it's transitional.

> The service definition in univention-management-module-udm.service looks
> like work in progress, with various lines commented out. I also do not
> understand why the service is started via bash, then 'exec's a python
> process, whose output is redirected to the logfile, when there are also the
> service config options StandardOutput= and StandardError=
Because our systemd version is too old, I implemented this workaround, which I copied from univention-self-service-invitation.service (See Bug #48446, you QAed that).
StandardOutput= and StandardError= are not yet supported. Maybe with Debian Buster?
 
> Also, the yaml files contain ONLY this bug. That is very dangerous. If i
> would set this bug to verified, the packages would be cleared to be
> released. I will add bug 27816 to the yaml files for now.
This is not necessary. The API is still in development and can be released at every stage which I commit. Nothing breaks with that.

> In a quick test i could not deactivate the service via UCR, i will have to
> check again - it might not be an issue with this package.
You could at least via systemd.
Comment 4 Florian Best univentionstaff 2019-08-22 18:35:20 CEST
(In reply to Florian Best from comment #3)
> > ~~: Should we install and start the api server by default? We are releasing
> > this as an erratum.
> That was Ingo's decision, yes.
I am also fine with waiting for Bug #27816 to get this released. But when Bug #27816 it must be installed and activated on every DC Master.
Comment 5 Erik Damrose univentionstaff 2019-08-22 18:41:22 CEST
(In reply to Florian Best from comment #3)
> > The service definition in univention-management-module-udm.service looks
> > like work in progress, with various lines commented out. I also do not
> > understand why the service is started via bash, then 'exec's a python
> > process, whose output is redirected to the logfile, when there are also the
> > service config options StandardOutput= and StandardError=
> Because our systemd version is too old, I implemented this workaround, which
> I copied from univention-self-service-invitation.service (See Bug #48446,
> you QAed that).
> StandardOutput= and StandardError= are not yet supported. Maybe with Debian
> Buster?

Thats what i meant with "the service definition looks like work in progress". If it is not working / necessary, it should be removed from the file. It is unclear what happens if we update to a systemd version that supports these (and other) options.

> > Also, the yaml files contain ONLY this bug. That is very dangerous. If i
> > would set this bug to verified, the packages would be cleared to be
> > released. I will add bug 27816 to the yaml files for now.
> This is not necessary. The API is still in development and can be released
> at every stage which I commit. Nothing breaks with that.

You say the API is still in development, but have no issue with it being released, installed, and run by default on every DC Master and Backup? Please correct me if i misunderstood you. But I wholeheartedly disagree with that mindset.
Comment 6 Florian Best univentionstaff 2019-08-26 12:45:09 CEST
The package python-uritemplate is another unmaintained dependecy. I cherry-picked it from 4.2-0-0 and build in the errata scope.

Package: python-uritemplate
Version: 0.6-1A~4.4.0.201908261116
Branch: ucs_4.4-0
Scope: errata4.4-1

python-uritemplate.yaml
dacbcc7485e6 | YAML ~Bug #50034
Comment 7 Felix Botner univentionstaff 2019-08-27 11:36:07 CEST
Currently the univention-management-module-udm breaks univention-server-..., and so all jenkins tests failed (system setup fails)

$ apt-get install univention-server-master 
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Einige Pakete konnten nicht installiert werden. Das kann bedeuten, dass
Sie eine unmögliche Situation angefordert haben oder, wenn Sie die
Unstable-Distribution verwenden, dass einige erforderliche Pakete noch
nicht erstellt wurden oder Incoming noch nicht verlassen haben.
Die folgenden Informationen helfen Ihnen vielleicht, die Situation zu lösen:

Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 univention-server-master : Hängt ab von: univention-management-module-udm (>= 9.0.12-26) soll aber nicht installiert werden
E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.
root@master:~# apt-get install univention-management-module-udm 
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Einige Pakete konnten nicht installiert werden. Das kann bedeuten, dass
Sie eine unmögliche Situation angefordert haben oder, wenn Sie die
Unstable-Distribution verwenden, dass einige erforderliche Pakete noch
nicht erstellt wurden oder Incoming noch nicht verlassen haben.
Die folgenden Informationen helfen Ihnen vielleicht, die Situation zu lösen:

Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 univention-management-module-udm : Hängt ab von: python-uritemplate ist aber nicht installierbar
E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.
root@master:~# apt-get install python-uritemplate
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Paket python-uritemplate ist nicht verfügbar, wird aber von einem anderen Paket
referenziert. Das kann heißen, dass das Paket fehlt, dass es abgelöst
wurde oder nur aus einer anderen Quelle verfügbar ist.

E: Für Paket »python-uritemplate« existiert kein Installationskandidat.

So i will REMOVE the univention-management-module-udm dependencies in univention-server!!!

Please re-add those after all the necessary packages are maintained.
Comment 8 Florian Best univentionstaff 2019-08-27 11:41:25 CEST
> So i will REMOVE the univention-management-module-udm dependencies in
> univention-server!!!
NO! They are build in errata-4.4-1 and added TODAY to the trigger list. Don't remove this!
Read the messages in the dev channel!
Comment 9 Felix Botner univentionstaff 2019-08-27 12:25:13 CEST
(In reply to Florian Best from comment #8)
> > So i will REMOVE the univention-management-module-udm dependencies in
> > univention-server!!!
> NO! They are build in errata-4.4-1 and added TODAY to the trigger list.
> Don't remove this!
> Read the messages in the dev channel!

ok, i will check today evening if it works, otherwise i will remove the dependency, and next time please check if the new package can be installed before adding the package as dependency
Comment 10 Florian Best univentionstaff 2019-08-27 12:34:51 CEST
(In reply to Felix Botner from comment #9)
> (In reply to Florian Best from comment #8)
> > > So i will REMOVE the univention-management-module-udm dependencies in
> > > univention-server!!!
> > NO! They are build in errata-4.4-1 and added TODAY to the trigger list.
> > Don't remove this!
> > Read the messages in the dev channel!
> 
> ok, i will check today evening if it works, otherwise i will remove the
> dependency, and next time please check if the new package can be installed
> before adding the package as dependency

I checked if it is installable and it was, just not via testing-software.univention.de.
It was not clear that when adding a package to maintained one needs to add it to the triggers immediately so that testing-software.univention.de works.
This was fixed in https://hutten.knut.univention.de/mediawiki/index.php?title=Errata-Updates&type=revision&diff=70537&oldid=69802.

I did not test if it works now but all the documented steps are done.
Comment 11 Felix Botner univentionstaff 2019-08-27 12:59:05 CEST
(In reply to Florian Best from comment #10)
> I checked if it is installable and it was, just not via
> testing-software.univention.de.
There you go

> I did not test if it works now but all the documented steps are done.
yep, works now with updates-test.software-univention.de, superb
Comment 12 Florian Best univentionstaff 2019-09-06 18:23:58 CEST
Everything done, but the package renaming is still in the branch (git:fbest/50034-package-rename) because we didn't decide for the final name yet.
Comment 13 Florian Best univentionstaff 2019-09-10 17:00:56 CEST
Reverted the part which installs the package dependencies and moved this into Bug #50171 with a patch attached.
Comment 14 Felix Botner univentionstaff 2019-09-10 18:45:07 CEST
OK - revert dependency in univention-server
OK - new binary package name
OK - new service name
Comment 15 Felix Botner univentionstaff 2019-09-10 18:46:23 CEST
OK - basic rest api call 
curl 'https://Administrator:univention@master.four.four/univention/udm/users/user/uid%3DAdministrator%2Ccn%3Dusers%2Cdc%3Dfour%2Cdc%3Dfour' -H 'Accept: application/json' | python -m json.tool
Comment 16 Felix Botner univentionstaff 2019-09-10 23:08:50 CEST
Somehow during the app test (with 4.4-1 errata-test packages) univention-server-master gets removed?

Starting univention-upgrade. Current UCS version is 4.4-1 errata251

Checking for local repository:                          none
Checking for package updates:                           found

The following packages will be REMOVED:
 univention-server-master
The following packages will be installed:
 python3-cached-property,python3-six,libsecret-common,libsecret-1-0,golang-docker-credential-helpers,python3-dockerpycreds,python3-urllib3,python3-chardet,python3-requests,python3-websocket,python3-docker,python3-dockerpty,python3-docopt,python3-jsonschema,python3-texttable,python3-yaml,runc,containerd,linux-image-4.9.0-11-amd64,linux-image-4.9.0-11-amd64-signed,python-dockerpycreds,irqbalance
The following packages will be upgraded:
 univention-config,python-univention-config-registry,univention-heimdal-kdc,univention-heimdal-common,univention-base-packages,shell-univention-lib,python-univention-lib,univention-base-files,libunivention-config0,univention-directory-listener,univention-admin-diary-client,python-univention-admin-diary,libunivention-license0,python-univention-license,univention-directory-manager-tools,python-univention-directory-manager,python-univention-directory-manager-cli,libcupsmime1,cups-core-drivers,cups-server-common,libcupscgi1,libcupsimage2,libcupsppdc1,ghostscript,libgs9,libgs9-common,cups-common,cups-ppdc,cups-bsd,cups-client,cups-daemon,libcups2,cups,libglib2.0-0,docker-compose,univention-appcenter-docker,univention-management-console-module-apps,univention-web-js,univention-web-style,univention-management-console-login,univention-management-console-frontend,univention-management-console-web-server,univention-management-console-module-join,univention-join,univention-management-console,univention-management-console-server,python-univention-management-console,univention-system-info,univention-management-console-module-sysinfo,univention-management-console-module-appcenter,univention-appcenter,python-univentio
Comment 17 Felix Botner univentionstaff 2019-09-11 11:06:03 CEST
(In reply to Felix Botner from comment #16)
> Somehow during the app test (with 4.4-1 errata-test packages)
> univention-server-master gets removed?
> 
> Starting univention-upgrade. Current UCS version is 4.4-1 errata251
> 
> Checking for local repository:                          none
> Checking for package updates:                           found
> 
> The following packages will be REMOVED:
>  univention-server-master
> The following packages will be installed:
>  python3-cached-property,python3-six,libsecret-common,libsecret-1-0,golang-
> docker-credential-helpers,python3-dockerpycreds,python3-urllib3,python3-
> chardet,python3-requests,python3-websocket,python3-docker,python3-dockerpty,
> python3-docopt,python3-jsonschema,python3-texttable,python3-yaml,runc,
> containerd,linux-image-4.9.0-11-amd64,linux-image-4.9.0-11-amd64-signed,
> python-dockerpycreds,irqbalance
> The following packages will be upgraded:
>  univention-config,python-univention-config-registry,univention-heimdal-kdc,
> univention-heimdal-common,univention-base-packages,shell-univention-lib,
> python-univention-lib,univention-base-files,libunivention-config0,univention-
> directory-listener,univention-admin-diary-client,python-univention-admin-
> diary,libunivention-license0,python-univention-license,univention-directory-
> manager-tools,python-univention-directory-manager,python-univention-
> directory-manager-cli,libcupsmime1,cups-core-drivers,cups-server-common,
> libcupscgi1,libcupsimage2,libcupsppdc1,ghostscript,libgs9,libgs9-common,cups-
> common,cups-ppdc,cups-bsd,cups-client,cups-daemon,libcups2,cups,libglib2.0-0,
> docker-compose,univention-appcenter-docker,univention-management-console-
> module-apps,univention-web-js,univention-web-style,univention-management-
> console-login,univention-management-console-frontend,univention-management-
> console-web-server,univention-management-console-module-join,univention-join,
> univention-management-console,univention-management-console-server,python-
> univention-management-console,univention-system-info,univention-management-
> console-module-sysinfo,univention-management-console-module-appcenter,
> univention-appcenter,python-univentio

this is gone, don't know when, don't know why ...
Comment 18 Felix Botner univentionstaff 2019-09-11 12:47:58 CEST
please update the yaml version
and u-d-m-rest is still unmaintained, i don't know if this is "fixed" during the errata release or if there is something missing

otherwise OK
Comment 19 Florian Best univentionstaff 2019-09-11 14:01:12 CEST
(In reply to Felix Botner from comment #18)
> please update the yaml version
Done

> and u-d-m-rest is still unmaintained, i don't know if this is "fixed" during
> the errata release or if there is something missing
I think this will be done during the release.
Comment 20 Erik Damrose univentionstaff 2019-09-11 14:14:03 CEST
(In reply to Florian Best from comment #19)
> > and u-d-m-rest is still unmaintained, i don't know if this is "fixed" during
> > the errata release or if there is something missing
> I think this will be done during the release.

I am reopening this quickly so it will not be forgotten: This has to be fixed before the release, as it was done with the initial package. The package should be in maintained even on the test server.
Comment 21 Felix Botner univentionstaff 2019-09-11 14:30:16 CEST
Just checked and now u-d-m-rest is maintained on updates-test.software-univention.de. Don't know what happened since yesterday.

This whole "add packages to maintained" is a total mystery to me.
Comment 22 Felix Botner univentionstaff 2019-09-12 11:02:03 CEST
FAIL
could you rename the "univention-management-server/autostart" variable (directory/manager/rest/autostart) and please add a description
TODO - yaml

rest ok

OK - jenkins tests
OK - ucs-test-rest tests
OK - not installed by default
OK - can be installed
OK - works after installation
Comment 23 Florian Best univentionstaff 2019-09-12 11:31:42 CEST
Renamed in:

univention-management-console-module-udm (9.0.14-2)
7b39f2e4562d | Bug #50034: rename autostart variable
Comment 24 Felix Botner univentionstaff 2019-09-12 12:25:20 CEST
(In reply to Florian Best from comment #23)
> Renamed in:
> 
> univention-management-console-module-udm (9.0.14-2)
> 7b39f2e4562d | Bug #50034: rename autostart variable

yep, please build the package and update the yaml file
Comment 25 Felix Botner univentionstaff 2019-09-16 13:13:19 CEST
got

dpkg: Fehler beim Bearbeiten des Archivs /tmp/apt-dpkg-install-NuM8Wp/5-univention-directory-manager-rest_9.0.15-3A~4.4.0.201909131904_all.deb (--unpack):
 Versuch, »/var/www/univention/udm/css/style.css« zu überschreiben, welches auch in Paket univention-management-module-udm 9.0.12-23A~4.4.0.201908061552 ist
dpkg-deb: Fehler: Unterprozess einfügen wurde durch Signal (Datenübergabe unterbrochen (broken pipe)) getötet
Vorbereitung zum Entpacken von .../6-univention-management-module-udm_9.0.14-3A~4.4.0.201909131608_all.deb ...
Entpacken von univention-management-module-udm (9.0.14-3A~4.4.0.201909131608) über (9.0.12-23A~4.4.0.201908061552) ...
Fehler traten auf beim Bearbeiten von:
 /tmp/apt-dpkg-install-NuM8Wp/5-univention-directory-manager-rest_9.0.15-3A~4.4.0.201909131904_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

during the update (with the old univention-management-module-udm package installed)
Comment 26 Felix Botner univentionstaff 2019-09-16 13:32:44 CEST
(In reply to Felix Botner from comment #25)
> got
> 
> dpkg: Fehler beim Bearbeiten des Archivs
> /tmp/apt-dpkg-install-NuM8Wp/5-univention-directory-manager-rest_9.0.15-3A~4.
> 4.0.201909131904_all.deb (--unpack):
>  Versuch, »/var/www/univention/udm/css/style.css« zu überschreiben, welches
> auch in Paket univention-management-module-udm 9.0.12-23A~4.4.0.201908061552
> ist
> dpkg-deb: Fehler: Unterprozess einfügen wurde durch Signal (Datenübergabe
> unterbrochen (broken pipe)) getötet
> Vorbereitung zum Entpacken von
> .../6-univention-management-module-udm_9.0.14-3A~4.4.0.201909131608_all.deb
> ...
> Entpacken von univention-management-module-udm
> (9.0.14-3A~4.4.0.201909131608) über (9.0.12-23A~4.4.0.201908061552) ...
> Fehler traten auf beim Bearbeiten von:
>  /tmp/apt-dpkg-install-NuM8Wp/5-univention-directory-manager-rest_9.0.15-
> 3A~4.4.0.201909131904_all.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> during the update (with the old univention-management-module-udm package
> installed)

Add Replaces and Breaks (univention-management-module-udm) to univention-directory-manager-rest binary package. Update works for me now.

Added univention-directory-manager-rest.yaml for Bug #50034 and #50047 and removed those from univention-management-console-module-udm.yaml.

@Florian, please check if the changes above are OK
Comment 27 Felix Botner univentionstaff 2019-09-16 15:22:35 CEST
OK - univention-directory-manager-rest.yaml
OK - univention-management-console-module-udm.yaml
OK - update
OK - installation