{"record":{"id":"45f9494e2736581f","repo":"hcengineering/platform","slug":"sequence-object-not-found-45f949","errorCode":null,"errorMessage":"sequence object not found","messagePattern":"sequence object not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"plugins/board-resources/src/components/popups/CopyCard.svelte","lineNumber":35,"sourceCode":"\n  const hierarchy = client.getHierarchy()\n  const dispatch = createEventDispatcher()\n\n  let inputRef: TextArea\n  let title = value.title\n  let status: Status = OK\n  const selected = {\n    space: value.space,\n    status: value.status,\n    rank: value.rank\n  }\n\n  async function copyCard (): Promise<void> {\n    const newCardId = generateId()\n\n    const sequence = await client.findOne(core.class.Sequence, { attachedTo: board.class.Card })\n    if (sequence === undefined) {\n      throw new Error('sequence object not found')\n    }\n\n    const incResult = await client.update(sequence, { $inc: { sequence: 1 } }, true)\n\n    const copy: AttachedData<Card> = {\n      status: selected.status,\n      number: (incResult as any).object.sequence,\n      title,\n      rank: selected.rank,\n      assignee: null,\n      description: '',\n      members: [],\n      location: '',\n      labels: value.labels,\n      startDate: value.startDate,\n      dueDate: value.dueDate\n    }\n","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/plugins/board-resources/src/components/popups/CopyCard.svelte#L17-L53","documentation":"CopyCard.svelte needs the Sequence object for `board.class.Card` to allocate a number for the duplicated card. If the sequence document cannot be found, copying aborts with this error. Like the other sequence errors, it signals a missing/uninitialized data object rather than a coding bug in the copy flow.","triggerScenarios":"`client.findOne(core.class.Sequence, { attachedTo: board.class.Card })` returns undefined when the user triggers card copy in the popup.","commonSituations":"Newly provisioned or imported workspaces missing seed data, sequences removed by data cleanup, or running against a DB snapshot that predates sequence creation.","solutions":["Execute the workspace upgrade routine to seed Sequence objects for cards.","Insert the missing Sequence document manually via an admin script.","Confirm the environment points at the intended database (staging vs prod) that actually has sequences."],"exampleFix":"// before\nconst sequence = await client.findOne(core.class.Sequence, { attachedTo: board.class.Card })\nif (sequence === undefined) throw new Error('sequence object not found')\n// after\nconst sequence = await client.findOne(core.class.Sequence, { attachedTo: board.class.Card })\nif (sequence === undefined) {\n  ui.notify('Card numbering is not initialized; run workspace upgrade')\n  return\n}","handlingStrategy":"try-catch","validationCode":"const sequence = await client.findOne(core.class.Sequence, { attachedTo: board.class.Card })\nif (sequence === undefined) { ui.notify('Sequence missing for cards'); return }","typeGuard":"function hasSequence(s: Sequence | undefined): s is Sequence { return s !== undefined }","tryCatchPattern":"try {\n  await copyCard()\n} catch (e) {\n  if (e instanceof Error && e.message === 'sequence object not found') {\n    ui.notify('Card copy failed: numbering sequence not initialized')\n  } else throw e\n}","preventionTips":["Include sequence seeding in workspace provisioning and upgrade checklists.","Guard copy/move flows with an existence check on dependent seed objects.","Restore missing sequences promptly; they block all card writes."],"tags":["data-model","missing-data","sequence"],"backgroundTag":"missing-sequence-object","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}