Repository navigation
Closed
Labels
self-hostingAnything self-hosted
Description
Past Issues Searched
- I have searched open and closed issues to make sure that the bug has not yet been reported
Issue is a Bug Report
- This is a bug report and not a feature request, nor asking for self-hosted support
Using official Plausible Cloud hosting or self-hosting?
Self-hosting
Describe the bug
Lost data (partially) after migration from v.1.5.2 to v.2.0.0.
Used instruction given in releases (2.0.0) page.
Hosting everything with Kubernetes, with official docker image: plausible/analytics:v2.0.0
My steps:
- Updated plausible and clickhouse images (clickhouse uses persistent volume, 10 GBs size, only 4.7Gbs occupied)
- Used
bin/plausible rpc Plausible.DataMigration.NumericIDs.runcommand and started migration (drop v2 table, drop-domains-lookup, create v2 tables, create create-domains-lookup, start migration (starting from partition: 202302 ... 202308 .... end, no errors)). - With browser, opened and logged in plausible portal, selected random site and noticed that data from March-April and June-July months is missing (February, May and current day, 01 August, are present there).
Used clickhouse-client cli to check db, noticed that new tables were created but not all events and sessions were copied:
~ Select Count(*) from events;
SELECT Count(*)
FROM events
Query id: ceea6192-8888-4aa4-877b-0e85ea3caf94
┌──count()─┐
│ 17250656 │
└────────┘
1 row in set. Elapsed: 0.006 sec.
~ Select Count(*) from events_v2;
SELECT Count(*)
FROM events_v2
Query id: d956210d-caf9-4910-9cd5-1596dbedd6fb
┌─count()─┐
│ 5727585 │
└───────┘
1 row in set. Elapsed: 0.035 sec.
~ Select Count(*) from sessions;
SELECT Count(*)
FROM sessions
Query id: a64f4d47-806b-4209-9d77-a4bba8283711
┌─count()─┐
│ 5592494 │
└───────┘
1 row in set. Elapsed: 0.005 sec.
~ Select Count(*) from sessions_v2;
SELECT Count(*)
FROM sessions_v2
Query id: 0d4aa78b-dbec-421f-b132-adb7ccd21c7d
┌─count()─┐
│ 3471330 │
└───────┘
Expected behavior
Expected to use plausible v2, but lost some data (on the new version) after migration from v.1.5.2 to v2.0.0.
Screenshots
Environment
- Deployment: Kubernetes/Docker
- Plausible: plausible/analytics:v2.0.0
- Clickhouse: clickhouse/clickhouse-server:22.6-alpine
- Browser: BraveMetadata
Metadata
Assignees
Labels
self-hostingAnything self-hosted


Activity
ruslandoga commentedon Aug 1, 2023
👋 @mark24slides
It'd be helpful if you could identify what exact data has been lost, i.e. what events are present in
eventsand are not present inevents_v2, also maybe checkdocker compose logs plausible_events_dbandsystem.mutationstable in ClickHouse.That sounds a bit like missed partitions. Would you mind rerunning the data migration and posting the logs here?
mark24slides commentedon Aug 2, 2023
@ruslandoga, thank you a lot, during own instigation and getting outputs for you I found the issue.
During
bin/plausible rpc Plausible.DataMigration.NumericIDs.runrun, had:plausible-events-db container had 2GBs memory (ram usage) limitation (for pod), volume (persistent) used 4.7 GBs (attached to plausible-events-db), after I temporary scaled memory (ram usage) limit to 5Gbs - migration went well.
It will be great to add something like:
Be sure that you have enough amount of free ram or high memory limit for plausible_events_db container, or you will get "DB::Exception: Memory limit (total) exceeded" error by clickhouse database, and missing data in migrated tables.after
You need enough free disk space available for x2 of the current plausible_events_db's event-data volume size. You can use something like docker system df -v | grep hosting_event-data to check how much space the current volume is occupying.in the releases page notes.
ruslandoga commentedon Aug 2, 2023
Thank you for the suggestion! And I'm glad you resolved your issue :)