fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Android setup experience apps can be marked "Failed" after installing successfully

Open AndreyKizimenko opened this issue 2 months ago • 5 comments

Fleet versions

  • Discovered: 4.92.0-rc.2609041753
  • Reproduced: 4.92.0-rc.2609041753

Web browser and operating system: Chrome running on macOS; Android 16 (Samsung SM-S906U1, BYOD work profile)


💥 Actual behavior

Apps installed during the Android setup experience can end up permanently marked "Failed" in Fleet even though they install successfully and are running on the device.

I enrolled a host with five apps in the setup experience. All five installed fine, but Fleet reports two of them (Google Chrome and WhatsApp Messenger) as failed. The host's own software inventory lists both as installed, so Fleet is contradicting itself on the same page. Nothing corrects it afterwards — the apps stay marked failed indefinitely.

The three apps that reported correctly and the two that didn't were all in the same Android status report. The difference was that AMAPI included an "install in progress" note for three of them and said nothing at all about the other two — and Fleet treats "no news" as failure.

🛠️ Expected behavior

An app that installs successfully should show as installed. If a status report doesn't mention an app yet, Fleet should keep waiting the way it already does when the report says the install is in progress — and if a later report says the app is installed, that should override an earlier failure.

🧑‍💻 Steps to reproduce

These steps:

  • [ ] Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
  • [x] Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
  1. Configure several Setup expeirience apps
  2. Enroll Android host into your fleet
  3. While it is enrolling, disable Wi-Fi on the host (when only some apps are installed)
  4. Remove work profile
  5. Re-enroll
  6. => Check activity, installed apps are reported as failed
Image

Reproducing it needs a device that doesn't report every app in every status report, so it may take a couple of enrollments to hit. It reproduced on the second enrollment for me, with two of five apps affected.

Second way to reproduce:

  1. Configure several Setup experience apps
  2. Enroll Android host into your fleet
  3. While it is enrolling, disable Wi-Fi on the host (when only some apps are installed)
  4. Wait for an hour.
  5. Re-enable Wifi on the host.

Third way to reproduce: (Confirmed this workflow has been fix)

  1. Configure several Setup experience apps (Include Pre-installed app Chrome)
  2. Enroll Android host into your fleet

🕯️ More info (optional)

verifyDeviceSoftware (server/mdm/android/service/pubsub.go:1641) decides each pending install's fate from a single status report:

  • app present in device.ApplicationReports with State == "INSTALLED" → verified
  • app has a non-compliance report saying PENDING / IN_PROGRESS → stays pending, waits for the next report
  • app in neither list → failed immediately

That last branch is what fires here, and the code flags it as an open question:

no non-compliance report, but also not reported as installed, give it another chance later if the applied version == requested version? For now, marking as failed, we don't know how long it might take for the device to receive another policy, it may never happen.

In practice the follow-up reports arrive within seconds, and the failure is unrecoverable: once verification_failed_at is set the row is no longer pending, ListHostMDMAndroidVPPAppsPendingInstallWithVersion stops returning it, and the later INSTALLED report can't correct it.

Server log from the run, all five apps in one status report at 19:52:16:

19:52:16 level=error msg="Software failed to install without non-compliance report" package_name=com.android.chrome installation_failure_reason="unknown - no non-compliance report received"
19:52:16 level=debug msg="Software not reported as installed yet, will remain pending" package_name=com.instagram.android non_compliance_reason=APP_NOT_INSTALLED installation_failure_reason=IN_PROGRESS
19:52:16 level=debug msg="Software not reported as installed yet, will remain pending" package_name=com.openai.chatgpt   non_compliance_reason=APP_NOT_INSTALLED installation_failure_reason=IN_PROGRESS
19:52:16 level=error msg="Software failed to install without non-compliance report" package_name=com.whatsapp            installation_failure_reason="unknown - no non-compliance report received"
19:52:16 level=debug msg="Software not reported as installed yet, will remain pending" package_name=org.telegram.messenger non_compliance_reason=APP_NOT_INSTALLED installation_failure_reason=IN_PROGRESS

The three deferred apps then resolved on their own a few seconds later:

19:52:20 msg="Software marked as verified" package_name=com.instagram.android
19:52:21 msg="Software marked as verified" package_name=com.openai.chatgpt
19:52:23 msg="Software marked as verified" package_name=org.telegram.messenger

Resulting state via the API — two apps failed, and both present in the host's inventory:

'ChatGPT'            status='installed'
'Google Chrome'      status='failed_install'     <- inventory: Chrome @ 152.0.7977.76
'Instagram'          status='installed'
'Telegram'           status='installed'
'WhatsApp Messenger' status='failed_install'     <- inventory: WhatsApp @ 2.26.34.81

Two possible fixes, either of which would have avoided this: treat "app absent from both lists" the same as IN_PROGRESS and wait for the next report, or let a later INSTALLED report clear an earlier verification_failed_at.

Not new in 4.92 — this logic came in 5a8e2774bf ("Android Setup Experience support", #35951), first released in 4.78.0. Found while QAing #43500 (the reset there behaved correctly; these are separate installs from the following enrollment, with different command UUIDs).

AndreyKizimenko avatar Sep 04 '26 20:09 AndreyKizimenko

Refining the root cause after more runs — the trigger isn't a payload randomly dropping an app.

At each failure the app was in neither ApplicationReports nor NonComplianceDetails. What separated the apps that survived from the ones that failed was only the non-compliance entry:

APP_NOT_INSTALLED / IN_PROGRESS → stayed pending no entry → failed
BYOD host Instagram, ChatGPT, Telegram Chrome, WhatsApp
Fully-managed host Instagram, ChatGPT, Telegram, WhatsApp Chrome

An app has no entry when its install hasn't started, and that happens two ways:

  1. Permanent — the app is already installed on the device. AMAPI has nothing to flag as APP_NOT_INSTALLED and never will. Chrome (pre-installed, 134.0.6998.135 on the fully-managed device) failed this way in every run — 4 of the 5 false failures observed.
  2. Transient — the install simply hasn't begun yet. Fleet created the install rows at 19:52:13 and ran the verification pass at 19:52:16; WhatsApp hadn't been picked up in those three seconds. It installed fine right afterwards, and it received normal IN_PROGRESS entries in every other run.

Same defect either way, so this stays one issue: "absent from both lists" is treated as a terminal failure, and the later INSTALLED report can't undo it. On the fully-managed host Chrome appeared in ApplicationReports seven seconds after being failed (21:20:25 → 21:20:32), by which point it was no longer in the pending set and the log just shows Software not marked as verified, checking if failed.

Reliable repro: put an app that is already installed on the device (Chrome on a stock Android) into a team's setup experience and enroll. It fails every time, no timing needed.

Also reproduced on a fully managed host, so it isn't work-profile specific.

AndreyKizimenko avatar Sep 04 '26 21:09 AndreyKizimenko

Hit a third trigger for this on 4.93.0-rc.2609242126 (fully-managed Samsung SM-A376U1, Android 16, enrolled via zero-touch into Unassigned). All three affected apps are installed on the device and show in the host's software inventory, but they stay marked Failed.

This time the apps did have an IN_PROGRESS entry. It cleared one report before the app showed up in ApplicationReports:

Status report (UTC) Gmail / Chrome / Maps in the report Fleet
18:57:50 APP_NOT_INSTALLED / IN_PROGRESS, not in ApplicationReports kept pending
18:57:59 no non-compliance entry (install finished), still not in ApplicationReports marked failed: "no non-compliance report received"
18:58:12 and later present in ApplicationReports ignored (no longer pending)

So even an app that goes through the normal in-progress → done sequence can land in the ~10s gap between the non-compliance entry clearing and the application report arriving. The fix described above (treat "no news" as still pending, and let a later INSTALLED override a failure) would cover this case too.

AndreyKizimenko avatar Sep 25 '26 19:09 AndreyKizimenko

  • Verified Pre-install app installed successful without error on BYOD and company-owned. Image

Reproduced:

  • Reproduced the apps installed failed after Wi-Fi was disabled overnight, with some apps installed and some still pending. Image

  • After disabling Wi-Fi mid-enrollment, removing the work profile, and re-enrolling, apps that were Pending showed as Failed in the activity log but stayed stuck at Pending on the host. Image

terry-kwok-code avatar Oct 14 '26 20:10 terry-kwok-code

With the fix, apps might first report as failed, but on the next host check-in, their successful installs will appear in the activity feed. Confirmed with design that this is OK Image

AndreyKizimenko avatar Oct 23 '26 21:10 AndreyKizimenko

Clouds part to reveal what was hidden all along trust the next report

fleet-release avatar Oct 29 '26 00:10 fleet-release