Skip to content

stim android --remote eas: install fails with 'Lease is not active' on a large APK (agent-device lease TTL vs upload time) #924

Closed

Description

@janicduplessis

Observed

stim android --remote eas --eas-profile development from a Windows host against trailhead (EAS Android build 9c84e29f, 449 MB debug APK) booted an EAS Android session in 3m17s and then failed at install with STIM_INSTALL_FAILED: UNAUTHORIZED: Lease is not active after 5m44s. agent-device diagnostics from the stim run and from a by-hand repro show the same sequence: lease_allocate with a 60 s TTL, a 1m47s APK upload with no heartbeat during the upload, then the install call against an expired lease.

This is an agent-device large-artifact issue, not stim or Windows: the iOS path (a 30 MB simulator .app) never hits it. Nothing upstream matches yet.

Done when

  • An upstream issue is filed against agent-device (lease TTL vs upload duration, or a heartbeat during upload) and linked here.
  • Stim, until that lands, either warns before install when the artifact is large relative to a 60 s lease (with the size and the expected upload time) or retries the install once with a fresh lease when agent-device answers Lease is not active. Whichever is smaller; a silent retry loop is not acceptable.
  • stim android --remote eas completes install and launch from a Windows host with the trailhead debug build. Note the debug APK is 449 MB; a release-variant EAS profile would be far smaller and worth documenting as the recommended remote Android profile.

Related: the Android --remote path still spawns an adb logcat collector for the session id (commands/android/launch.ts:694), the Android analog of #917 item 2.

Origin: #923 field run. EAS cost of that run: one Android build (27m45s) and one session (~10.5 min).

Activity

  1. janicduplessis commented on Sep 24, 2026

    @janicduplessis
    CollaboratorAuthor

    Claimed: fix/924-eas-lease-retry

  2. janicduplessis commented on Sep 24, 2026

    @janicduplessis
    CollaboratorAuthor

    Upstream issue filed: callstack/agent-device#2946 - the lease is not renewed during artifact upload. #1029 works around it with the 5-minute proxy lease policy.

  3. janicduplessis commented on Sep 25, 2026

    @janicduplessis
    CollaboratorAuthor

    Claimed: fix/1096-ios-remote-lease-platform

  4. janicduplessis commented on Sep 25, 2026

    @janicduplessis
    CollaboratorAuthor

    Status after #1127 and #1130 (both merged):

    Released: fix/1096-ios-remote-lease-platform

  5. janicduplessis commented on Sep 25, 2026

    @janicduplessis
    CollaboratorAuthor

    Closing: the failure is agent-device's lease not being renewed during a large artifact upload, tracked upstream as callstack/agent-device#2946; it is not Windows-specific (the original diagnosis already showed that).

    Evidence on macOS with the same trailhead debug APK (449 MB): stim android --remote eas --eas-profile development installed in 1m45s under the 5-minute proxy lease (#1029) and launched with a verified bundle (#1130); session 01a0d6c5-3084-7008-b245-ca1d9d048f32 ended STOPPED. The related logcat item is fixed in #1130.

    Remaining risk: iOS stays on the default 60 s lease because agent-device refuses iOS installs under the proxy lease (callstack/agent-device#2962, Stim workaround #1127), so a very large iOS simulator app can still hit this until #2946 or #2962 is fixed upstream.

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

    type: bugBreaks documented or expected behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions