hcengineering / hcengineering/platform

[Bug] Cards app crashes on load with ObjectNotFound (card:types:File/Document) on fresh self-hosted v0.7.432 workspace

Open
#11,022 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
27.7k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Huly version: v0.7.432 (`hardcoreeng/front`, `hardcoreeng/workspace`, `hardcoreeng/transactor`, `hardcoreeng/tool`, `hardcoreeng/account`, all pulled fresh from Docker Hub the same day this was reproduced)
- Deployment: Self-hosted (docker-compose, adapted from `hcengineering/huly-selfhost`, running on Coolify)
- Database: CockroachDB (`cockroachdb/cockroach:latest-v24.2`)
- Role: OWNER

## Steps to reproduce

1. `docker run hardcoreeng/tool:v0.7.432 bundle.js create-workspace ` — create a **brand-new workspace** (no data migrated from anywhere, no prior version history).
2. Log in as the owner and open the **Cards** app: `/workbench//card/all` or `/workbench//card/browser`.

## Expected behavior

Cards app loads (even if empty — 0 cards, 0 spaces).

## Actual behavior

App crashes immediately on load with `core:status:ObjectNotFound`, before any user interaction (confirmed it also fires just from navigating there, and from creating a new card space).

## Console errors

```
core:status:ObjectNotFound {"_id":["card:types:File","card:types:Document","contact:class:UserProfile","chat:masterTag:Thread","communication:type:Direct","communication:type:Poll"]}
at y.getObject (memdb.js:85:13)
at Qo (ClassRefPresenter.svelte:24:58)
at De (Component.js:135:5)
...
at Wf (Table.svelte:496:34)
```

Followed by a cascading render crash:
```
TypeError: Cannot read properties of undefined (reading 'parentNode')
at j (14214...js:2:6821)
```

Preceded during model load by ~15-30 occurrences of (varying per attempt/session, IDs differ each time the workspace model is rebuilt):
```
no document found, failed to apply model transaction, skipping _id="..." _class="core:class:TxUpdateDoc" objectId="..."
```

## Root cause (as far as I could isolate it)

The front-end bundle for v0.7.432 references built-in "Cards" MasterTag/type classes (`card:types:File`, `card:types:Document`, `contact:class:UserProfile`, `chat:masterTag:Thread`, `communication:type:Direct`, `communication:type:Poll`) unconditionally when rendering the Cards/Spaces `Table.svelte` "Type" column — but the `workspace`/`transactor` services for the **same** v0.7.432 image do not appear to seed/create these type documents when building a new workspace's model. `getObject()` on the client then throws `ObjectNotFound` because the objects were never created server-side.

This is **not** a data-migration or version-jump artifact — I confirmed it reproduces identically on a **100% fresh, empty workspace** created directly via `tool create-workspace` on a clean CockroachDB (no restore, no migration from an older workspace). I also confirmed:
- Deleting all existing card data (`public.card` rows) does not help — the crash is unrelated to data content.
- `tool upgrade-workspace --force` completes successfully (`upgrade-workspace done`) without resolving it.
- `hardcoreeng/front:v0.7.426`'s bundle contains **zero** occurrences of `card:types` anywhere — the Cards app is entirely new since that version, and its self-hosted bootstrap path appears incomplete.

## Additional context

Similar in shape to #10772 (Controlled Documents "New category" crash) — same `no document found, failed to apply model transaction, skipping` warning signature, same self-hosted CockroachDB setup, also traced to a feature whose required seed/model documents aren't present after workspace creation/upgrade.

Happy to run any runtime probe commands (`findAll(core:class:Class, ...)`, etc.) against this workspace if that helps narrow it down further.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Cards/Spaces Table.svelte Type column and trace the built-in type references through workspace model creation. Compare a fresh workspace made with tool create-workspace and the upgrade-workspace path, using the reported ObjectNotFound and skipped model transaction logs. Done means a fresh self-hosted workspace opens Cards without the ObjectNotFound or cascading render crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.