hcengineering/platform · error
sequence object not found
Error message
sequence object not found
What it means
Creating a board Card requires a Sequence document attached to board.class.Card to assign the card's number. When findOne on core.class.Sequence returns undefined, numbering is impossible and this error is thrown. It indicates missing seed data in the workspace.
Source
Thrown at plugins/board-resources/src/utils/CardUtils.ts:22
type TxOperations as Client,
type TxResult,
type Ref,
type Space,
type AttachedData,
type Status
} from '@hcengineering/core'
import { showPanel } from '@hcengineering/ui'
import board from '../plugin'
export async function createCard (
client: Client,
space: Ref<Space>,
status: Ref<Status>,
attribues: Partial<AttachedData<Card>> & { kind: Card['kind'] }
): Promise<Ref<Card>> {
const sequence = await client.findOne(core.class.Sequence, { attachedTo: board.class.Card })
if (sequence === undefined) {
throw new Error('sequence object not found')
}
const incResult = await client.update(sequence, { $inc: { sequence: 1 } }, true)
const number = (incResult as any).object.sequence
const value: AttachedData<Card> = {
title: '',
status,
startDate: null,
dueDate: null,
number,
rank: '',
assignee: null,
identifier: `CARD-${number}`,
description: '',
...attribues
}
View on GitHub (pinned to 63e28dc964)
Solutions
- Create the missing Sequence document attached to board.class.Card
- Re-run workspace seed/initialization that registers sequences
- Restore Sequence documents from backup
Example fix
// before: error thrown because sequence missing
// after: ensure sequence exists
let seq = await client.findOne(core.class.Sequence, { attachedTo: board.class.Card })
if (seq === undefined) {
await client.createDoc(core.class.Sequence, core.space.Model, { attachedTo: board.class.Card, sequence: 0 })
}
await createCard(...) Defensive patterns
Strategy: validation
Validate before calling
const seq = await client.findOne(core.class.Sequence, { attachedTo: board.class.Card })
if (seq === undefined) throw new Error('Board card sequence not seeded') Type guard
const isSequence = (s: Sequence | undefined): s is Sequence => s !== undefined
Try / catch
try {
await createCard(client, space, status, attrs)
} catch (err) {
if ((err as Error).message === 'sequence object not found') {
await seedCardSequence(client) // create missing Sequence, then retry
return createCard(client, space, status, attrs)
} else throw err
} Prevention
- Ensure board workspace bootstrap creates the Card sequence
- Add an integration test asserting Sequence exists before card creation
- Avoid manual deletion of Sequence documents in production data
When it happens
Trigger: Calling createCard in a workspace where the Sequence attached to board.class.Card was never created or was deleted.
Common situations: Newly provisioned workspace without board sequence bootstrap; data migration dropped Sequence docs; test environments built from partial fixtures; admin cleanup removed Sequence objects.
Related errors
- sequence object not found
- contact not found
- sequence object not found
- contact not found
- adapter not provided: ${name}
AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29).
Data as JSON: /api/errors/0ba918d30675226c.
Report an issue: GitHub.