Self-host: can we fix data-folder ownership on container start so leftover import CSVs don’t waste disk space? #6548
EmmS21
started this conversation in
Anything Else
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is related to this issue #6515 (and the bugfix that scopes Oban import-failure handling to
ImportAnalyticsonly).I made an MR such that a failed
LocalImportAnalyticsCleanerno longer purges ClickHouse import stats.It got me thinking, on self-hosted CE, we could have leftover CSVs that remain on disk when
File.rm!returns permission denied, meaning there is a file permissions issue.Retries wouldn't help if the permission state never changes. This is wasted space that accumulates for the user.
Proposal
I'd treat this as a small CE image / entrypoint change rather than something in the product UI.
When the container starts as root, the entrypoint would
chown -Rthe data dir to theplausibleuser, thensu-execdown and start the app as it does today.If someone already runs the container as a non-root user (
-u 1000, etc.), we'd skip thechownand keep the current behavior.Alternatives I considered
Logger/ Sentry via Oban) rather than product notifications.LocalImportAnalyticsCleaneris that second category; disk hygiene after the import already finished. Surfacing un-deletable CSVs the same way as a failed import would mix two different meanings for the user.Any concerns or thoughts about this approach?
All reactions