Skip to content

A lease whose new device fails to boot always says "Timed out waiting for device to boot" with code INTERNAL, whatever the driver's reason #1229

Closed

Description

@V3RON

`DeviceProvisioner.provision` catches every `makeReady` failure of a new device, logs the driver's error, and throws `new BootTimeoutError(device.id)` (`src/core/device-provisioner.ts:126`, `:142`). The requester sees only `Timed out waiting for device to boot: `, even when the driver failed at once with a clear reason (a `DriverCrashError` naming another emulator on the console port, an emulator that exited). `BootTimeoutError` has no wire code, so it answers `INTERNAL` (#1199's output).

{"error":{"code":"INTERNAL","message":"Timed out waiting for device to boot: dev_0a628b60-..."}}

The test pins this today: `src/core/device-provisioner.test.ts` "rolls back a registered device and returns BootTimeoutError-compatible failure on boot failure". A fix keeps `BootTimeoutError` (reason `boot-timeout`) but carries the driver's message, and could give it a code of its own.

Found while triaging #1199.

Written by an agent.

Activity

  1. added
    bug:new
    on Nov 3, 2026
  2. V3RON commented on Nov 3, 2026

    @V3RON
    ContributorAuthor

    Triage (automated)

    Confirmed in code on main: src/core/device-provisioner.ts:125-142 logs the driver's error and always throws new BootTimeoutError(device.id). The comment there says this is on purpose ("The caller only ever sees BootTimeoutError"), and src/core/AGENTS.md:85 and src/leasing/AGENTS.md:60 describe the same behaviour. So a fix also updates those two manuals.

    • Platform: core code, so it affects both iOS and Android. The drivers throw their own BootTimeoutError for real timeouts (src/drivers/ios/index.ts:802, :816, src/drivers/android/index.ts:2129); the provisioner turns every other failure into one too.
    • The coordinator matches instanceof BootTimeoutError and rejects with reason boot-timeout (src/leasing/lease-acquisition-coordinator.ts:915-917). The fix the issue proposes (keep the class, carry the driver's message) keeps that path working.
    • Related, not a duplicate: Android leases time out with no reason when the emulator rejects -crash-report-mode (Emulator 36.1.9) #1199 (the case that showed it). No other open issue covers this.

    Left for a maintainer: whether the error gets its own wire code (that changes the public error surface and the website docs), and whether to move it to bug:ready. Label stays bug:new.

    Written by an agent.

  3. V3RON commented on Nov 3, 2026

    @V3RON
    ContributorAuthor

    Fixed as part of #1199 (scope note there).

    Written by an agent.

  4. V3RON commented on Nov 6, 2026

    @V3RON
    ContributorAuthor

    Fixed on main by #1232 (7344677). DeviceProvisioner now throws BootTimeoutError carrying the driver's message (src/core/device-provisioner.ts:182). The test src/core/device-provisioner.test.ts "rolls back a registered device and gives the requester BootTimeoutError carrying the driver's message on boot failure" pins it. No separate wire code was added; open a request if one is wanted.

    Written by an agent.

  5. V3RON commented on Nov 9, 2026

    @V3RON
    ContributorAuthor

    Seen again in the pre-release e2e pass after v0.6.0 (main at 30f8fad9): with android.bootTimeoutMs=1000 a lease fails with {"error":{"code":"INTERNAL","message":"Timed out waiting for device to boot: simlock"}}, event lease.rejected reason boot-timeout. The message is carried now, but a boot timeout is still INTERNAL (BootTimeoutError has no wire code and errors.mdx does not list it), so an agent cannot tell it from a daemon fault. The closing note said to open a request if a code is wanted; this is the evidence for one. The iOS side (PROVISION_FAILED, reason unresolvable-spec) is filed separately.

    Written by an agent.

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

    bug:new

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions