{"record":{"id":"b38c2f1a3b9ec996","repo":"nexu-io/open-design","slug":"cloudflare-zone-inactive","errorCode":"cloudflare_zone_inactive","errorMessage":"Cloudflare custom domains require an active zone.","messagePattern":"Cloudflare custom domains require an active zone\\.","errorType":"http","errorClass":"DeployError","httpStatus":400,"severity":"error","filePath":"apps/daemon/src/deploy.ts","lineNumber":606,"sourceCode":"\nasync function validateCloudflarePagesDeploySelection(config: DeployConfig, selection: CloudflarePagesDeploySelection | null): Promise<CloudflarePagesDeploySelection | null> {\n  if (!selection) return null;\n  const resp = await fetch(`${CLOUDFLARE_API}/zones/${encodeURIComponent(selection.zoneId)}`, {\n    headers: cloudflareHeaders(config),\n  });\n  const json = await readCloudflareJson(resp);\n  if (!resp.ok || json?.success === false) {\n    throw cloudflareError(json, resp.status, 'Cloudflare zone lookup failed.');\n  }\n  const zone = json?.result ?? json;\n  const zoneName = normalizeCloudflareZoneName(zone?.name);\n  if (!zoneName || zoneName !== selection.zoneName) {\n    throw new DeployError('Cloudflare zone selection no longer matches the selected domain.', 400, {\n      errorCode: 'cloudflare_zone_mismatch',\n    });\n  }\n  if (zone?.status && zone.status !== 'active') {\n    throw new DeployError('Cloudflare custom domains require an active zone.', 400, {\n      errorCode: 'cloudflare_zone_inactive',\n    });\n  }\n  if (zone?.type && zone.type !== 'full') {\n    throw new DeployError('Cloudflare custom domains require a full DNS zone.', 400, {\n      errorCode: 'cloudflare_zone_not_full',\n    });\n  }\n  return { ...selection, zoneName };\n}\n\nasync function setupCloudflarePagesCustomDomain({ config, projectId, selection, pagesDevUrl, priorMetadata }: { config: DeployConfig; projectId: string; selection: CloudflarePagesDeploySelection; pagesDevUrl: string; priorMetadata?: JsonObject | undefined }) {\n  if (!config.projectName) throw new DeployError('Cloudflare Pages project name could not be generated.', 400);\n  const pagesTarget = normalizeHostname(hostnameFromUrl(pagesDevUrl) || `${config.projectName}.pages.dev`);\n  const marker = cloudflarePagesDnsMarker(projectId, config.projectName, pagesTarget);\n  const base = {\n    hostname: selection.hostname,\n    url: `https://${selection.hostname}`,","sourceCodeStart":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/deploy.ts#L588-L624","documentation":"Thrown by validateCloudflarePagesDeploySelection in apps/daemon/src/deploy.ts:606 as `DeployError('Cloudflare custom domains require an active zone.', 400, { errorCode: 'cloudflare_zone_inactive' })` when the fetched zone has a `status` field that is not `'active'`. Cloudflare must finish provisioning the zone (nameservers verified) before it can host DNS records and a Pages custom domain, so pending/parked/moved zones are rejected. The guard is skipped only when `zone.status` is absent.","triggerScenarios":"The selected zone resolves and matches by name, but its Cloudflare-reported `status` is e.g. `pending` (nameservers not yet verified), `moved`, `deactivated`, or `initializing`.","commonSituations":"Newly added zone where nameserver verification hasn't completed; zone temporarily deactivated; zone in the process of being moved away from Cloudflare.","solutions":["Complete Cloudflare nameserver setup for the zone (update NS records at the registrar) and wait for status to become 'active'.","Verify status in the Cloudflare dashboard -> Overview for that zone.","Retry the deploy/custom-domain setup after the zone shows active."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"function isZoneInactive(err: unknown): boolean {\n  return err instanceof DeployError && err.status === 400\n    && (err as any).details?.errorCode === 'cloudflare_zone_inactive';\n}","tryCatchPattern":"try {\n  await deployToCloudflarePages({ config, files, projectId, cloudflarePages: selection });\n} catch (err) {\n  if (isZoneInactive(err)) {\n    return res.status(400).json({\n      error: 'The selected zone is not active yet. Complete nameserver setup in Cloudflare and retry.',\n      errorCode: 'cloudflare_zone_inactive',\n    });\n  }\n  throw err;\n}","preventionTips":["Filter the zone picker to only zones with status 'active'.","Before enabling custom domains, instruct users to finish nameserver verification at their registrar.","Poll/retry after a delay once the zone shows active in Cloudflare."],"tags":["deploy","cloudflare","custom-domain","zone","dns"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}