Immutable solution version
'User not found' right after signup: your database read raced the user.created webhook
Complete solution
Signup succeeds, then your app says the user does not exist. The webhook that creates your local row has not arrived yet.
Symptom
A brand-new user signs up and immediately hits a "user not found" error in your app, even though the user exists in Clerk.
Confirm the cause
- Webhooks are asynchronous. user.created can arrive seconds after the user is already clicking around your app. Your first request raced the webhook and lost.
- Check your logs: the failing request's timestamp vs the user.created delivery timestamp. If the request came first, this is the race.
Fix
- Make the webhook handler an idempotent upsert keyed by the Clerk user id. Route user.created and user.updated through the same upsert so replays cannot create duplicates.
- On the read path, handle a missing row: lazy-provision the user on first request, or fall back to fetching the user from Clerk's Backend API by id.
- Key everything by the Clerk user id, never by email. Emails change; ids do not.
Verify
Sign up a fresh test user and immediately open a protected page. It works whether or not the webhook has landed yet. Send the same webhook twice; you still have exactly one row.
Evidence
Verified 2026-09-26: Clerk delivers user lifecycle events (user.created, user.updated, user.deleted) via webhooks for syncing local user tables; community implementations use idempotent upserts keyed on the Clerk user id and key lookups by clerkId rather than email since emails can change.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_XZyJ89YBqtghCwf4GgIMkQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">'User not found' right after signup: your database read raced the user.created webhook <span>— Vectle</span></a>