Bug 53048 - ucsschool-id-connector trash-directory is never cleaned up by the app
ucsschool-id-connector trash-directory is never cleaned up by the app
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: ucsschool-id-connector
UCS@school 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: Alexander Steffen
Tobias Wenzel
https://git.knut.univention.de/univen...
:
Depends on:
Blocks: 56235
  Show dependency treegraph
 
Reported: 2021-04-09 13:45 CEST by Marc Schwarz
Modified: 2023-06-30 13:23 CEST (History)
7 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.206
Enterprise Customer affected?:
School Customer affected?: Yes
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 Marc Schwarz univentionstaff 2021-04-09 13:45:15 CEST
The folder 

/var/lib/univention-appcenter/apps/ucsschool-id-connector/data/listener/trash/

consumed 12.2GB within 6 months of usage.

I suggest a way to set an automatic removal of those json-Files in a logrotate-ish way.
Comment 1 Dirk Ahrnke univentionstaff 2021-04-09 15:47:55 CEST
another customer, running the connector for 3 weeks with <10% of the final user-base has 50k files in the trash directory, using 200 MB disk space.

Do we really need to keep obviously processed items by default?
Comment 2 Daniel Tröder univentionstaff 2021-04-12 08:41:20 CEST
The idea was, that the user will remove those in a cronjob, but has the chance to make a backup.

If you have a working solution using logrotate or a cronjob, please append a patch here. I'd be happy to integrate it into the app.
Comment 5 Daniel Tröder univentionstaff 2022-02-11 08:18:39 CET
I suggest to create a cronjob in the join script.

Please feel free to create a merge request for this file: https://git.knut.univention.de/univention/components/ucsschool-id-connector/-/blob/master/appcenter_scripts/inst
Comment 7 Alexander Steffen univentionstaff 2023-06-15 08:46:47 CEST
Fixed and merged.
Version: 2.2.6
Commit: 2d2b6179e1e8cac884c7c7330a9ce9ac98e47598

Defaults:
trash_delete_state = 1 (on)
trash_delete_offset = 30 (days)


To test manually:
0) Adapt variables (optional)
1) Create a file in the trash folder, which is older than the specified number of days with:

touch -a -m -t <date> "/var/lib/univention-appcenter/apps/ucsschool-id-connector/data/listener/trash/test.json"

2) Run "python3 /etc/periodic/daily/listener_trash_cleaner"

If the created file was older than the specified number of days, it will be deleted from /var/lib/univention-appcenter/apps/ucsschool-id-connector/data/listener/trash/"
Comment 8 Tobias Wenzel univentionstaff 2023-06-15 09:42:50 CEST
The bugfix has been reviewed on the linked merge request.

- [x] code ok
- [x] tests were written
- [x] jenkins very happy
- [x] pipelines green
- [x] docu: ok
Comment 9 Tobias Wenzel univentionstaff 2023-06-15 13:56:12 CEST
Updates for UCS@school ID Connector 2.2.6 have been released.

    https://docs.software-univention.de/ucsschool-id-connector/HISTORY.html

If this error occurs again, please clone this bug.