Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Adding a custom domain with an initial misconfigured DNS config keeps staying in error mode forever #373

Open
Xennis opened this issue Dec 21, 2023 · 0 comments

Comments

@Xennis
Copy link

Xennis commented Dec 21, 2023

Issue

Under certain conditions, a custom domain never gets green in the UI. It's stuck in "Invalid Configuration".

The "verify" endpoint keeps returning an "Invalid Configuration". If you call the Vercel API manually via cURL it shows "misconfigured": false.

Steps to reproduce

  • Add a custom domain
  • Misconfigure the DNS settings for this domain
  • See in the UI the "Invalid Configuration" error (or call the "verify" endpoint)
  • Fix the DNS settings so they are correct
  • In the UI you continue to see an "Invalid Configuration" (or call the "verify" endpoint)

Analysis

  • The verify endpoint calls the getConfigResponse. This function uses fetch

platforms/lib/domains.ts

Lines 85 to 96 in 29e20e7

return await fetch(
`https://api.vercel.com/v6/domains/${domain}/config${
process.env.TEAM_ID_VERCEL ? `?teamId=${process.env.TEAM_ID_VERCEL}` : ""
}`,
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
"Content-Type": "application/json",
},
},
).then((res) => res.json());

=> Theory: The issue appears because the fetch in getConfigResponse is cached and never revalidated. Due to the initial misconfiguration, the function and hence the whole endpoint keeps returning an "Invalid Configuration".

A possible fix is to add a revalidation or turn off caching for this particular fetch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant