Skip to content
Latchkey

Neon "endpoint ... not found" in CI

The endpoint id embedded in the Neon host no longer maps to a live compute. Either the per-PR branch was deleted, or DATABASE_URL points at an old endpoint from a previous run. The host cannot resolve to a running compute.

What this error means

A connection fails with "could not translate host name ... to address" for an ep-...neon.tech host, or neonctl reports "endpoint ... not found" for the branch.

psql
psql: error: could not translate host name
"ep-old-name-000000.us-east-2.aws.neon.tech" to address: Name or service not known

Common causes

The branch and its endpoint were deleted

A cleanup job removed the per-PR branch (and its compute) but a later step still holds the old connection string.

A stale DATABASE_URL from a prior run

The secret or artifact carrying the connection string points at an endpoint that no longer exists.

How to fix it

Re-derive the connection string for the current branch

  1. Confirm the branch still exists with neonctl branches list.
  2. Regenerate the connection string for the live branch at CI time.
  3. Order cleanup after all steps that use the branch so it is not deleted early.
Terminal
neonctl connection-string "pr-${{ github.event.number }}" \
  --project-id "$NEON_PROJECT_ID" --pooled

Create the branch before using it

Ensure the create-branch step runs and succeeds before any step reads its connection string.

Terminal
neonctl branches create --name "pr-${{ github.event.number }}" --project-id "$NEON_PROJECT_ID"

How to prevent it

  • Derive the connection string in the same run that creates the branch.
  • Run branch cleanup only after all dependent steps complete.
  • Never carry a Neon host between runs; regenerate it each time.

Frequently asked questions

What causes "Neon "endpoint not found""?
A cleanup job removed the per-PR branch (and its compute) but a later step still holds the old connection string.
How do I fix Neon "endpoint not found"?
Re-derive the connection string for the current branch

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card