Skip to content

runtime/cli: os start on an OS_DATABASE_URL sqlite file whose directory cannot be made hangs with no timeout: createStandaloneStack's synchronous recursive mkdirSync loops on ENOENT under an existing parent (the #23696 class, a second producer) #23737

Closed

Description

@objectstack-fleet

Found while delivering #23696 (PR #23730), outside its scope.

Filing gate: (a) a reachable defect at a public door, measured by #23696's cloud dev (report 6203616771, out_of_scope_findings[0], class a; open_questions[1] recommends a separate card, and this seat takes it). Filed by domain:engine seat 1 (#6367) · sunhaolin · session_01GP3comALHRcRBixS2TEnLF. ⛔ Not a claim. Reader who acts: triage, for the grade and the lane (finding). By the lane table the producer is in packages/runtime (domain:cli).

What happens

reach: the public door os start (built CLI, no config, OS_DATABASE_URL=file:/proc/os-23696/ctl.db). It prints → Starting server... and then hangs. The dev killed it at 25 s; there was no timeout and no refusal. Under strace, the respawned server's main thread made 21,443 failing mkdir("/proc/os-23696") calls in 12 s. The loop is synchronous, so no plugin start timeout can fire.

Producer: packages/runtime/src/standalone-stack.ts#createStandaloneStack, the sqlite arm's mkdirSync(resolvePath(filename, …), { recursive: true }) (line 789 at f40d877f8). The sqlite-wasm arm (line 775) carries the same line. packages/cli/src/commands/dev.ts (about line 577, os dev) has the same shape and is unmeasured.

Mechanism (the same class #23696 fixed in driver-sql, measured there with strace and a bare node -e): Node v22's recursive mkdir makes the level and gets ENOENT. It then finds the parent (/proc) exists (EEXIST, statx reads a directory) and retries the level, without end.

After PR #23730: objectstack serve with the same URL is refused in about 2.7 s, naming the datasource, the path and ENOENT (the driver's bounded walk, packages/drivers/driver-sql/src/sqlite-database-file.ts#makeDatabaseDirectory). os start never reaches the driver, because the host's own mkdirSync loops first.

Wanted

Pins: the uncreatable path refused at once at os start, naming the path and the error. CONTROL: a creatable path boots. A negative control that fails when the fix is removed.

Order: after PR #23730 (#23696), whose makeDatabaseDirectory this may reuse.

Dedupe

The words os start hangs sqlite database url uncreatable directory standalone stack mkdirSync recursive never returns match only #23696 (the driver producer, PR #23730) and #23648 (closed, unrelated). None is this.


Generated by Claude Code

Activity

  1. added
    bug
    finding
    on Oct 15, 2026
  2. objectstack-fleet commented on Oct 16, 2026

    @objectstack-fleet
    ContributorAuthor

    First grade · domain:cli · p2 · pm:queue · triage seat · session_01AavokzJ5DndAwitDXvKy4U · 2026-10-16T00:59Z

    Read in this act: the body in full, 0 comments.

    ⛔ Not a claim.

  3. added
    domain:cli
    pm:queue
    priority:p2
    pm:dispatched
    and removed
    finding
    pm:queue
    on Oct 16, 2026
  4. objectstack-fleet commented on Oct 16, 2026

    @objectstack-fleet
    ContributorAuthor

    Claim: PM loop round 1, serial (the maintainer's 「后续改为串行派发」 in this seat's chat, this session). Label order: #23826 (p1 target:v18) ranks first but waits on #23816's ceremony files (note on #23826); this card is the oldest open bug at priority:p2 in domain:cli's queue. #23737: os start (and os dev, if measured the same) on an OS_DATABASE_URL SQLite file whose directory cannot be made refuses at once, naming the path and the OS error, instead of hanging in the host's recursive mkdirSync · 2026-10-16T07:13Z
    Session: session_01PFB9ZGRWYvjhTXsd8i6KBp
    Account: marchtian (the seat's linked user as GET /user answers it; always the card's assignee)
    Branch: claude/issue-23737-uncreatable-db-dir-refusal
    Worktree: objectstack-issue-23737
    Domain: domain:cli
    Seat: domain:cli#1 (seat post #6024)
    File surface (read on origin/main 43567a8fcb; line numbers move; stop on a breach and explain it in the report):


    Generated by Claude Code

  5. objectstack-fleet commented on Oct 16, 2026

    @objectstack-fleet
    ContributorAuthor

    os-dev-report
    {
    "issue": 23737,
    "status": "done",
    "branch": "claude/issue-23737-uncreatable-db-dir-refusal",
    "pr": "#23851",
    "session": "session_01PFB9ZGRWYvjhTXsd8i6KBp",
    "premise_still_valid": true,
    "summary": "Premise held on origin/main 43567a8: os start with OS_DATABASE_URL=file:/proc/os-23737/ctl.db hung (killed at 25 s); createStandaloneStack alone looped 19,640 failing mkdir calls in 10 s; the sqlite-wasm arm (wasm-sqlite:// or OS_DATABASE_DRIVER=sqlite-wasm) looped too; os dev hung in two shapes: its serve child under an env URL (58,613 calls), and its own process at dev.ts unified-default prep under OS_HOME=/proc/os-23737 (64,440 calls in 25 s). Both standalone-stack arms now await a module-private bounded walk (the driver-sql makeDatabaseDirectory shape) that refuses at once with SqliteDatabaseDirectoryError naming file, directory and OS code, never the URL; the mkdir stays on the host per ADR-0062 #3826, and the read-only skip is unchanged. dev.ts unified-default prep goes through a new module-level prepareDevDatabaseDirectory (same walk) and exits 1 with the refusal plus a remedy line; no package-entry export added, no packages/spec edit. After (built CLI): os start exits 1 in 9.3 s (wasm arm 9.1 s, os dev env shape 9.1 s, os dev OS_HOME shape 4.3 s) naming path + ENOENT; CONTROL nested creatable path boots to Server is ready with a/b/c made.",
    "tests": "Pins: packages/runtime/src/standalone-stack-uncreatable-db-directory.test.ts 4/4 pass (/proc case for both arms in a node --import tsx child bounded 30 s SIGKILL; ENOTDIR+EEXIST in-process; CONTROL nested creatable both arms; CONTROL read-only boot makes no dir); packages/cli/src/commands/dev-database-directory.test.ts 4/4 pass, file 7.16 s (all cases in ONE child bounded 45 s; /proc ENOENT, ENOTDIR, CONTROL creatable, CONTROL non-default source untouched). Suites at head 70777e1 (under os-verify-lock): pnpm --filter @objectstack/runtime exec vitest run --project local -> 400 files passed, 5983 passed / 19 skipped, VERDICT command-exit 0; pnpm --filter @objectstack/cli exec vitest run --project unit -> 298 files passed, 4438 passed, VERDICT command-exit 0; runtime+cli typecheck -> exit 0, check:test-typecheck OK for both with no new debt. Ablation (committed fix, scripts/ablation-replace.mjs inside a trap-guarded script, subject resolves to src in both runners so no dist leg): RUNTIME anchor await makeSqliteDatabaseDirectory(filename); x2->x0, replacement (original recursive mkdirSync via await import node:fs) x0->x2, blob ca7e1c0c79a4->76537e4c8f4a; result 2 failed / 2 passed: /proc case had not settled after 30057 ms (child killed by SIGKILL), ENOTDIR case expected the raw Node message to contain the db filename, CONTROLs green; restore proven blob==HEAD ca7e1c0c79a4, git diff HEAD empty. CLI anchor const missing x1->x0 replaced by fs.mkdirSync(directory, recursive) return x0->x1, blob c31d6cd08223->89ecc6801be3; result file FAIL, beforeAll had not settled after 45080 ms (child killed by SIGKILL), 4 cases skipped; restore proven blob==HEAD c31d6cd08223, git diff HEAD empty. Fixed state 4/4 + 4/4. Direction observed: runtime /proc red by bound + ENOTDIR red; CLI red at the shared hook (cases skipped, file failed).",
    "gates": "Local (head 70777e1): node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 65; each run with exit captured before any pipe; --ran reconciliation exit 0: 65 derived, 63 run exit 0, 2 NOT MEASURED (exit 3 PREREQUISITE NOT MET), 0 UNRUN. NOT MEASURED: pnpm check:dual-build-cjs-loads (9 packages outside this build closure have no dist/), pnpm check:i18n-coverage (examples/app-showcase needs @objectstack/connector-slack built). Re-run after prerequisite met, recorded with the re-run code: node scripts/check-plugin-teardown-shape.mjs --self-test (first exit 3, shallow clone lacked pinned commit 621a487; fetched; exit 0, 48 cases); pnpm check:type-check-debt (first exit 3, queue-timeout 99 behind this card own CLI unit run on the verify lock; re-run under the lock exit 0). eslint --no-inline-config --max-warnings=0 over the 4 changed .ts files: exit 0. Control-byte scan over all 5 changed files: none. CI on PR 23851 head 70777e1 at report time: No other open PR may claim the same issue = success; Packed-tarball smoke (opt-in) = skipped; every other check-run in_progress (Check Changeset, Lint 7 lanes incl. ESLint and PM dispatch-gates, Type Check 4 lanes, Governed Surface Queue Guard, single-writer path, closing-card claim, Part-of guard, PR size, docs links, docs-affected, filter). Test Core / Build Core not yet listed at read time. Convergence is the seat's read.",
    "mcp_calls": "0 — no MCP GitHub tool used",
    "api_writes": "2 relay strokes (each POST /repos/objectstack-ai/objectstack/dispatches via scripts/pm/fleet-write/dispatch.mjs, executed as objectstack-fleet[bot]): stroke 1 pr_create = POST /repos/objectstack-ai/objectstack/pulls (draft) + POST /repos//issues/23851/assignees [marchtian], run 38876516842 success, body read back 9967/9967 identical; stroke 2 comment = POST /repos//issues/23737/comments (this report). git push x4 (not REST). label-write: 0 (dispatch named no labels; skip-changeset does not apply, the diff publishes).",
    "open_questions": [],
    "out_of_scope_findings": [
    "class: a · reach: public door os start, measured: OS_HOME=/proc/os-23737-home os start (no config, built CLI) hangs in the os start process itself, 176,004 failing mkdir("/proc/os-23737-home") calls in 20 s under strace, killed at the bound; producer packages/cli/src/commands/start.ts fs.mkdirSync(path.join(homeDir, "data"), { recursive: true }) (about :189; :658 is the same shape on homeDir) · same family as the driver (23696) and host (23737) recursive-mkdir loops — name it into that family's closing card rather than a single-point card · siblings read, not measured: packages/runtime/src/default-host.ts :136 (empty-boot stub artifact under OS_HOME), packages/runtime/src/package-state-store.ts :153, packages/runtime/src/artifact-reference.ts :395, packages/cli/src/commands/serve.ts :978 · dedupe words: os start OS_HOME uncreatable state directory recursive mkdirSync hang homeDir data",
    "carrier: none (承接者:无) · the bounded walk now exists in three module-private copies (driver-sql makeDatabaseDirectory, runtime makeSqliteDatabaseDirectory, cli prepareDevDatabaseDirectory); consolidating needs a published export, fenced from this claim · noted in PR Acceptance notes, not filed"
    ],
    "line_budget": "n/a — no skills/** path touched",
    "deviations": [
    "Three strace probe process groups from my own os dev / os start measurements (PGIDs 9366, 9721, 15378) survived their bound because the probe recorded the subshell pid instead of the setsid group; they kept looping on mkdir for 31-53 min until found at 08:26 UTC and killed by those recorded PGIDs (now zombies under init, no CPU). Box load was about 9 on 4 cores in that window, so wall readings taken then (pin child walls, gate durations) are shared-box figures.",
    "The dispatch pin "assert the exit at os start" is held as a public-door measurement (exit 1, path and ENOENT named) plus in-repo pins on createStandaloneStack and prepareDevDatabaseDirectory, not as a permanent os start e2e test: a source-entry spawn of os start runs two tsx start-ups (6.5 s floor each per the CLI suite own measurement), over the 10 s per-file line. The seat may ask for the e2e.",
    "Runtime test:repo project and the CLI integration tier not run locally: the diff touches neither a repo-project test nor an integration-tier file or spawn entry; both are CI's.",
    "ran.final.list replaces two exit-3 records with their re-run codes (teardown self-test after fetching commit 621a487 into the shared object store with git fetch origin SHA; type-check-debt re-run under the lock). The original runner record is kept beside it."
    ],
    "files_changed": [
    ".changeset/23737-uncreatable-db-dir-refusal.md",
    "packages/cli/src/commands/dev-database-directory.test.ts",
    "packages/cli/src/commands/dev.ts",
    "packages/runtime/src/standalone-stack-uncreatable-db-directory.test.ts",
    "packages/runtime/src/standalone-stack.ts"
    ]
    }

  6. objectstack-fleet commented on Oct 16, 2026

    @objectstack-fleet
    ContributorAuthor

    ACCEPT → PR #23851 comment 6212075084 · domain:cli seat 1 · marchtian · 2026-10-16T09:08Z. Filed from the report: #23858 (the recursive-mkdir family-closing card). Landing follows once the head's Test Core shards finish green.


    Generated by Claude Code

  7. removed
    pm:dispatched
    on Oct 16, 2026
  8. objectstack-fleet commented on Oct 16, 2026

    @objectstack-fleet
    ContributorAuthor

    Landed: PR #23851 merged through the queue as f7a5ebed78 · domain:cli seat 1 · marchtian · session session_01PFB9ZGRWYvjhTXsd8i6KBp · 2026-10-16T09:42Z.

    Reading Value
    PR #23851 merged: true, merged_at 2026-10-16T09:40:52Z; timeline added_to_merge_queue 2026-10-16T09:18:50Z
    origin/main f7a5ebed78 is an ancestor (fetched in this act); single parent (squash)
    Queue branch gh-readonly-queue/main/pr-23851-*: 0 refs left
    Landed content makeSqliteDatabaseDirectory 3 hits in packages/runtime/src/standalone-stack.ts; prepareDevDatabaseDirectory 2 hits in packages/cli/src/commands/dev.ts (both on origin/main)

    State: #23737 closed completed by Fixes #23737; pm:dispatched stripped in this act (domain:cli, priority:p2, bug stay). The family's remainder is #23858. The seat's hold on standalone-stack.ts's mkdirSync arms and dev.ts:577 is released.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:clipriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions