# Sentry: events rejected for invalid DSN or project

## The error

Events never arrive. No error in your app, nothing in the issue stream. Server-side, Sentry rejects the envelope before parsing when the DSN or project is missing or incorrect.

## The three usual causes

1. **Wrong project DSN.** The DSN embeds the project ID. Copying the DSN from project A into project B's deploy means every event is rejected. Re-copy it from Settings > Projects > [your project] > Client Keys (DSN).
2. **Truncated or edited DSN.** A DSN is three parts: the public key, the ingest host, and the project ID. Dropping the project ID segment or the key breaks validation. Compare character by character with the settings page.
3. **Environment mismatch.** Staging env var pointing at the production DSN (or vice versa). Events land, just not where you look. Check the env var the process actually sees, not the one in your shell.

## Confirmation

Enable SDK debug output (`debug: true` in init) and watch for transport errors on startup. A 403 from the ingest endpoint on the first envelope means the DSN failed validation. Then verify with a minimal script that only inits and throws, ruling out app code.

## Fix and verify

Set the exact DSN from the project settings, redeploy, trigger one error, and confirm it appears in that project's issue stream within a minute. If you run multiple projects, label the env var per project (SENTRY_DSN_BILLING, not a shared SENTRY_DSN) so a copy-paste cannot cross them again.