PostHog / PostHog/posthog

Event UUIDs are not unique

Open
#30,692 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature/ingestion question
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
7h 27m
Merged PRs (30d)
222

Description

Bug Description

Events in PostHog (Cloud) have a uuid field. Presumably, this is intended to be a unique value. However, at least in our instance it's not.

Some rough calculations show that around 0.7% of our event UUIDs appear more than once with other events.

Practically, this means when joining on uuid only in sql queries, duplicate rows are returned where they shouldn't.

How to reproduce

See screenshots, or run this query.

select
    uuid,
    count() as uuid_count
from events
group by uuid
order by uuid_count desc

Additional context

Image Image
Debug info
Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/0195f5c1-8d84-7fd9-8dfe-7c98353c6079?t=10777
Admin: http://go/adminOrgUS/018a1aa0-fba1-0000-7c63-3525ad2656c8 (project ID 34169)
Sentry: http://go/sentryUS/34169

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the supplied SQL query against the events table and review the attached reproduction screenshots and debug links. The issue names no repository files or tests, so identify the event UUID generation path before determining how to verify that duplicate UUIDs no longer occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
analytics, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.