Skip to content

This enrollment error could be an outdated version of Android#43021

Closed
spalmesano0 wants to merge 3 commits intomainfrom
android-enrollment-error
Closed

This enrollment error could be an outdated version of Android#43021
spalmesano0 wants to merge 3 commits intomainfrom
android-enrollment-error

Conversation

@spalmesano0
Copy link
Copy Markdown
Member

@spalmesano0 spalmesano0 commented Apr 4, 2026

Reported by pingali on Slack.

@spalmesano0 spalmesano0 self-assigned this Apr 4, 2026
@spalmesano0 spalmesano0 requested a review from a team as a code owner April 4, 2026 18:24
Copilot AI review requested due to automatic review settings April 4, 2026 18:24
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Android enrollment error messaging on the OTA enrollment page to suggest that failures to fetch an enrollment token may be due to an unsupported Android version.

Changes:

  • Updated the error description shown when fetching the Android enrollment token fails (fully managed flow).
  • Updated the error description shown when fetching the Android enrollment token fails (non-fully managed Android flow).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.84%. Comparing base (77639d5) to head (db4ee86).
⚠️ Report is 44 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #43021      +/-   ##
==========================================
- Coverage   66.85%   66.84%   -0.01%     
==========================================
  Files        2578     2578              
  Lines      206880   206869      -11     
  Branches     9166     9168       +2     
==========================================
- Hits       138312   138289      -23     
- Misses      55995    56007      +12     
  Partials    12573    12573              
Flag Coverage Δ
backend 68.61% <ø> (-0.01%) ⬇️
frontend 54.78% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@MagnusHJensen MagnusHJensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to fix what the AI suggested, else the page is broken for all occurrences.

On a further note, I'm not entirely convinced this is true.
The code path for creating an enrollment token, does not take any device data into consideration, so I would have a hard time seeing how Android/Google could say it can't create one, due to Android 14.

As these enrollment tokens aren't unique to a certain device per say.

Here us the code for what we send on this request:

enrollmentTokenRequest, err := json.Marshal(enrollmentTokenRequest{
EnrollSecret: enrollSecret,
IdpUUID: idpUUID,
})
if err != nil {
return nil, ctxerr.Wrap(ctx, err, "marshalling enrollment token request")
}
personalUsageSetting := "PERSONAL_USAGE_ALLOWED"
if fullyManaged {
personalUsageSetting = "PERSONAL_USAGE_DISALLOWED"
}
token := &androidmanagement.EnrollmentToken{
// Default duration is 1 hour
AdditionalData: string(enrollmentTokenRequest),
AllowPersonalUsage: personalUsageSetting,
PolicyName: fmt.Sprintf("%s/policies/%d", enterprise.Name(), android.DefaultAndroidPolicyID),
OneTimeOnly: true,
}
token, err = svc.androidAPIClient.EnterprisesEnrollmentTokensCreate(ctx, enterprise.Name(), token)
if err != nil {

spalmesano0 and others added 2 commits April 6, 2026 12:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@spalmesano0
Copy link
Copy Markdown
Member Author

You need to fix what the AI suggested, else the page is broken for all occurrences.

Ah, just saw that and committed those. I guess I thought the two different quote sections were for line breaks.

On a further note, I'm not entirely convinced this is true. The code path for creating an enrollment token, does not take any device data into consideration, so I would have a hard time seeing how Android/Google could say it can't create one, due to Android 14.

Tough for me to test, since all my Android devices are on supported versions. From what the customer reported, it sounded like these errors may be showing because of an outdated device.

What would happen if an old Android device could load this page? Would it still be able to enroll in Fleet?

@MagnusHJensen
Copy link
Copy Markdown
Member

MagnusHJensen commented Apr 6, 2026

It can fine load the page and generate the token.

image

It also successfully enroll via the Work profile flow
image

@spalmesano0
Copy link
Copy Markdown
Member Author

I'll close this then, since it doesn't seem appropriate to add the error message.

@spalmesano0 spalmesano0 closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants