Skip to content

Bug: E2E shard boots with a broken Convex node executor — every node action fails 'Cannot find module /tmp/.../modules/<fn>.js' #2631

Closed as not planned

Description

@yannickmonney

Problem

Intermittently, one Playwright platform shard's local Convex backend boots into a state where every node action fails with the node executor unable to find its own extracted source:

[CONVEX A(organizations/actions:initializeDefaultWorkflows)] Server Error
Cannot find module '/tmp/.tmpNVAFWc/source/cfdccccd-3055-4549-8f1a-1f540bedffd6/modules/organizations/actions.js' imported from /
[CONVEX A(branding/file_actions:readBranding)] Server Error
Cannot find module '/tmp/.tmpNVAFWc/source/.../modules/branding/file_actions.js' imported from /

The shard then burns its full budget on retries: auth-account.spec.ts stalls in createOrgViaWizard (tests/e2e/helpers/auth.ts:160) waiting for the provider step's Skip button, because organizations/actions:initializeDefaultWorkflows (a node action in the org-create flow) dies — while POST /api/auth/organization/create and set-active both return 200 (db-side fine). Even readBranding on the login page fails, so the poisoning is executor-wide and never self-heals for the shard's ~15-minute life.

Current behaviour (evidence)

Proposed change

  1. Diagnose the extraction race in the local backend's node executor at boot (double push during tale dev E2E boot — npx convex dev --once preflight + dev-engine — is a candidate window; the executor keeps serving a source dir that no longer exists).
  2. Repo-side mitigation regardless of root cause: after the webServer boot (services/platform/playwright.config.ts webServer → scripts/dev.ts), probe one cheap node action and fail the boot with a distinctive error if it can't resolve its module — turning 15 minutes of opaque spec retries into an immediate, greppable boot failure.

Acceptance criteria

  • A boot-time probe (or equivalent) makes a broken node executor fail the E2E webServer start with an explicit "node executor unhealthy" error instead of per-spec timeouts.
  • Root cause of the missing /tmp/.tmp*/source/<uuid> extraction identified and fixed or upstream-reported (convex-local-backend).
  • auth-account.spec.ts no longer fails with this signature across 20 consecutive E2E runs (no Cannot find module .../modules/ in any shard's console).

Activity

  1. yannickmonney commented on Jul 11, 2026

    @yannickmonney
    ContributorAuthor

    Reproduced on a plain local dev boot (2026-07-11, main @ 94ef84e) — this is not E2E-shard-specific:

    1. bun scripts/dev.ts cold boot (60s, full module push) → node actions work.
    2. Kill the dev script, start it again → second boot is fast (19s, module push skipped as tree unchanged) → every node action fails with Cannot find module '/var/folders/…/T/.tmpXXXX/source/<uuid>/modules/<fn>.js' imported from …/local.cjs.

    Observed failing on that boot: organizations/actions:initializeDefaultWorkflows (blocks the create-org wizard entirely — see #2635 for the silent-failure UI), workflow_engine/internal_actions:scanAndTrigger (cron, retries and errors every minute), agents/file_actions:listAgents (chat shows "No agents available").

    Recovery that worked: force any content change under convex/ (I dropped a throwaway convex/_qa_touch.ts with export {}, then deleted it) — the watcher's full re-push restores the executor immediately.

    So the trigger looks like: a fresh backend process + a skipped/no-op push leaves the node executor's extracted source dir unpopulated; the failing paths reference the previous boot's temp dir contents. Anything that guarantees a real push on boot (or re-extraction from storage) should fix both the E2E shards and local dev.

  2. yannickmonney commented on Jul 11, 2026

    @yannickmonney
    ContributorAuthor

    Status after PR #2674: AC 1 shipped — scripts/node-executor-probe.ts probes a cheap node action after the E2E webServer boot and fails the start with a distinctive node executor unhealthy error instead of 15 minutes of per-spec retries. AC 2 (root cause): hypothesis documented — dev-engine.ts runs convex dev --once preflight then a separate persistent spawnConvex(), a literal double-push window in which the executor can keep serving an extracted source dir that no longer exists; unverified beyond static reading, likely needs an upstream convex-local-backend report. AC 3 needs 20 consecutive clean CI runs — observable only after merge.

  3. yannickmonney commented on Jul 12, 2026

    @yannickmonney
    ContributorAuthor

    Two more reproductions on a local dev stack (2026-07-12, main @ 5605bf5, mode A per tests/manual/SETUP.md):

    1. First boot after a fresh bun install: org scaffolding silently failed — save-auth-state.ts timed out waiting for the seeded "E2E Assistant" (its node action never ran); no error surfaced anywhere user-visible.
    2. A later restart of bun scripts/dev.ts against the existing .convex/local state hit the same broken-executor condition.

    Both recovered deterministically with the touch-file workaround (create + delete a throwaway convex/_qa_touch.ts with export {} to force the watcher's module re-push), verified green by scripts/node-executor-probe.ts each time. The probe is a reliable detector; the failure mode remains "boot that skips the module push".

  4. yannickmonney commented on Jul 18, 2026

    @yannickmonney
    ContributorAuthor

    Fresh frequency evidence from the chat-TTFT PR series (2026-07-18): this extraction race was the only source of CI red across three consecutive PRs, hitting a different shard each time during the E2E preflight boot:

    Each time a plain gh run rerun --failed passed on the retry, so it's purely the boot-time extraction race (~1-in-16 shard boots across these runs). Also reproduced locally twice in the same period (recovery: touch-file re-push). Worth a bump in priority — it currently taxes every PR with a manual rerun round-trip.

  5. yannickmonney commented on Sep 27, 2026

    @yannickmonney
    ContributorAuthor

    Closing as obsolete. fd5c009 (#3107, v0.5.0) deleted the local Convex backend and its node executor, including convex.config.ts and scripts/node-executor-probe.ts. Dev and E2E now boot the Hono backend (services/platform/scripts/backend-supervisor.ts, dev-engine.ts), so the source-extraction race cannot occur.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions