{"record":{"id":"4381ba783a674276","repo":"nexu-io/open-design","slug":"brand-not-found-opts-id","errorCode":null,"errorMessage":"brand not found: ${opts.id}","messagePattern":"brand not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/daemon/src/brands/index.ts","lineNumber":689,"sourceCode":"      if (isClosedDatabaseError(err)) return null;\n      console.warn(`[brand] failed to reconcile programmatic extraction transcript for ${id}`, err);\n      return null;\n    })\n    .finally(() => {\n      extractionSettled = true;\n      clearTimeout(stallTimer);\n      clearTimeout(hardCapTimer);\n    });\n  input.onBackgroundExtraction?.(settled);\n\n  return settled;\n}\n\nexport async function continueBrandExtraction(\n  opts: ContinueBrandExtractionOptions,\n): Promise<StartBrandExtractionResult> {\n  const detail = readBrandDetail(opts.brandsRoot, opts.id);\n  if (!detail) throw new Error(`brand not found: ${opts.id}`);\n  const { meta } = detail;\n  const sourceUrl = meta.sourceUrl;\n  const projectId = meta.projectId ?? brandProjectId(opts.id);\n  const project = getProject(opts.db, projectId);\n  if (!project) throw new Error(`brand backing project not found: ${projectId}`);\n\n  const randomId = opts.randomId ?? randomUUID;\n  const locale = normalizeBrandKitLocale(opts.locale ?? meta.locale);\n  const hasWebsiteSource = /^https?:\\/\\//i.test(sourceUrl);\n  const designMd = readDesignMdInput(opts.brandsRoot, opts.id);\n  const hasDesignMdSource = Boolean(designMd) || sourceUrl.startsWith('designmd://');\n  const host = hostnameOf(sourceUrl);\n  const now = Date.now();\n  const extractionAttemptId = newBrandExtractionAttemptId();\n  const conversationId = resolveBrandRetryConversationId({\n    db: opts.db,\n    projectId,\n    preferredConversationId: meta.conversationId ?? null,","sourceCodeStart":671,"sourceCodeEnd":707,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/brands/index.ts#L671-L707","documentation":"Thrown by continueBrandExtraction when readBrandDetail(brandsRoot, opts.id) returns null, i.e. no brand directory/meta exists for that id. The route handler maps /not found/i to HTTP 404.","triggerScenarios":"Continuing an extraction for a brand id that was deleted, never created, or was mistyped; the brandsRoot was changed/relocated between requests.","commonSituations":"Restarting after clearing the data directory; a stale client link from a previous session; copy-paste error in the id.","solutions":["List brands via the brand list endpoint to confirm the id exists.","If the brand was deleted, start a new extraction with startBrandExtraction instead of continue.","Verify the daemon is using the expected brandsRoot (OD_DATA_DIR / RUNTIME_DATA_DIR)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const detail = readBrandDetail(brandsRoot, opts.id);\nif (!detail) {\n  throw new NotFoundError(`No brand with id '${opts.id}'. Create one with startBrandExtraction first.`);\n}","typeGuard":"function isExistingBrand(detail: unknown): detail is BrandDetailResponse {\n  return detail !== null && detail !== undefined;\n}","tryCatchPattern":"try {\n  await continueBrandExtraction(opts);\n} catch (err) {\n  if (err instanceof Error && /^brand not found:/.test(err.message)) {\n    return notFound('That brand no longer exists. Start a new extraction.');\n  }\n  throw err;\n}","preventionTips":["List brands before offering a Continue action in the UI.","Invalidate client-side references when a brand is deleted.","Confirm the daemon's brandsRoot is the same one where the brand was created."],"tags":["brands","not-found","lifecycle"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}