platforms icon indicating copy to clipboard operation
platforms copied to clipboard

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

Open Xennis opened this issue 2 years ago • 0 comments

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

https://github.com/vercel/platforms/blob/29e20e790eaf17d4d5051c23a69636dce724c174/lib/domains.ts#L85-L96

=> 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.

Xennis avatar Dec 21 '23 15:12 Xennis