Troubleshooting
Common issues and how to resolve them.
Webhooks Not Firing
Symptoms: Payments succeed but credits aren't granted.
Every delivery is recorded, so start by asking the database instead of guessing:
select received_at, provider, event_type, status, attempts, last_error
from webhook_event order by received_at desc limit 20;| What you see | What it means | Fix |
|---|---|---|
| No rows at all | Provider never reached us | Check the endpoint URL in the provider dashboard, and that Deployment Protection / an auth wall isn't intercepting requests |
status = failed, last_error mentions signature | Wrong secret/key deployed | pnpm verify:signature https://your-domain.com |
status = ignored, reason skip:no-user | Event carries no resolvable user_id — usually a deleted account | Manual review / refund |
status = ignored, payment-applier-not-implemented | Order landed before credit granting existed | pnpm payments:replay |
status = processed but no credits | Credit grant is keyed on payment.provider_payment_id; the payment may already have been granted | Check payment + credit_ledger for that payment |
Two things that look like "our endpoint is broken" but aren't:
- A CDN proxy in front of the app (Cloudflare orange cloud) can rewrite the body, so the signature never verifies. Use DNS-only.
- Dodo's SDK default tolerance is 5 minutes while retries span ~18 hours. This repo verifies by hand with a 24-hour window for exactly that reason — if you swap in the SDK helper, later retries will all 401 and the events will be lost.
Annual Credits Not Auto-Granting
Symptoms: Users on yearly plans don't receive monthly credits.
- Verify cron job is running (check
/api/cron/subscription-grants) - Check
subscriptionCreditScheduletable fornextGrantAttimestamps - Ensure
CRON_SECRETis configured correctly
User Can't Access Admin Panel
- Confirm
user.role = 'admin'in the database - Check
features/admin/components/admin-guard.tsxlogic - Ensure the user's session is valid (try logging out and back in)
Email Not Sending
- Verify
RESEND_API_KEYis set correctly - Check Resend dashboard for delivery logs
- In development, emails may use
onboarding@resend.devas sender - For production, verify your sending domain in Resend
AI API Returning Errors
- Check
VOLCANO_ENGINE_API_KEYis valid - Verify
VOLCANO_ENGINE_API_URLendpoint - Check your Volcano Engine quota/balance
- Review server logs for specific error messages
Database Connection Issues
- Verify
DATABASE_URLconnection string - Ensure
?sslmode=requirefor cloud databases - Check if your IP is allowlisted (if using IP restrictions)
- Try connecting directly:
psql $DATABASE_URL
Build Errors After Upgrade
If you encounter TypeScript errors after upgrading dependencies:
# Clear Next.js cache
rm -rf .next
# Reinstall dependencies
pnpm install
# Try building again
pnpm build