Skip to content

sentry init doesn't detect env vars when deciding whether to reuse a project #820

@sentry-junior

Description

@sentry-junior

sentry init is not detecting DSNs supplied via environment variables, so it creates a new project instead of reusing the existing one.

  • reported by <@U095QF26U23> in Slack while testing sentry init
  • confirmed behavior: init should create a project only when there is no DSN in the repo; if there is one, it should reuse it
  • current gap: the repo had the DSN as an env var rather than a hardcoded string, and init did not catch it
  • this came up while testing a project with a Next.js app plus a supabase/ folder containing edge functions
  • related context from the thread: init also currently does not add integrations during setup; that is expected and separate from this bug

Possible repro shape:

  • configure a project to provide the DSN via environment variable
  • run sentry init
  • observe that init creates a new Sentry project instead of reusing the existing one

This seems like DSN detection is currently limited to hardcoded strings / checked-in config and is missing env-based project reuse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions