The rotation of the `http.log` behaves in a weird way. Entries from the same date appear in different "old" logs. Example: ``` DEV root@ucs-001:/var/log/univention/ucsschool-kelvin-rest-api# ls -lrt [...] -rw------- 1 root root 25501 Mai 7 02:00 http.log.2023-05-06 -rw------- 1 root root 43403 Mai 9 02:00 http.log.2023-05-07 -rw------- 1 root root 365887 Mai 9 08:25 ucs-school-validation.log.2023-05-05 -rw------- 1 root root 590863 Mai 9 10:43 http.log.2023-05-08 -rw------- 1 root root 5515993 Mai 9 12:33 ucs-school-validation.log -rw-r----- 1 root root 305397697 Mai 9 12:36 opa.log -rw------- 1 root root 28963364 Mai 9 12:36 http.log DEV root@ucs-001:/var/log/univention/ucsschool-kelvin-rest-api# grep -c 2023-05-09 * http.log:123443 http.log.2023-05-07:33 http.log.2023-05-08:3254 ```
Fix suggestion: Follow the App Centers example in #55610 and 1. install a logrotate configuration in the host using UCRV without a service restart 2. use logging.handlers.WatchedFileHandler (https://devdocs.io/python~3.11/library/logging.handlers#logging.handlers.WatchedFileHandler) inside Docker container. From the docs: emit(): Outputs the record to the file, but first calls reopenIfNeeded() to reopen the file if it has changed. reopenIfNeeded(): Checks to see if the file has changed. If it has, the existing stream is flushed and closed and the file opened again, typically as a precursor to outputting the record to the file. So renaming the logfile (from the host) leads to the Python process - the next time it wants to write a message (!) - flushing its buffers to the renamed file and then creating a new file for the new message. If the renamed file is not compressed immediately there should be no data loss. --- If this fixes the logrotation issue for Kelvin, apply this fix also to all other UCS@school Python Docker apps like the UCS@school APIs app and the ID-Connector.
From UCS 5.2 on → Bug 56058, applications in Docker containers should log to STDOUT only! The logs will be sent to journald, from where they can be extracted to files using rsyslog.
But the customer will need a backport to 5.0.10, i guess.
Knowledge base article available for workaround. https://help.univention.com/t/problem-log-rotation-for-opa-log-missing-after-updating-kelvin-rest-api/24485
UCS@school Kelvin REST API 3.0.0 has been released. https://docs.software-univention.de/ucsschool-kelvin-rest-api/changelog.html#v3-0-0-2025-09-02 If this error occurs again, please clone this bug.