Provisioning stalls at "Setting admin privilege to esper agent" with `ERROR` during Device Owner rights grant
Android
If your device provisioning stalls at the "Setting admin privilege to esper agent" step with an error message, this is typically caused by an existing Device Owner registration on the device. Follow these steps to resolve the issue.
Before you begin
This error occurs when your device already has another account registered as Device Owner from a previous MDM enrollment, an earlier Esper provisioning attempt, or a residual management profile. Android only allows one Device Owner per device, so any existing Device Owner registration must be removed before Esper can be provisioned.
Step 1: Check for an existing Device Owner
Use ADB (Android Debug Bridge) to check if your device has an existing Device Owner:
adb shell dpm list-owners
If any package is listed as Device Owner, you must remove it before proceeding with Esper provisioning.
Step 2: Perform a factory reset
Factory reset your device to clear all Device Owner registrations and management profiles.
Option 1: Reset from device settings
- On the device, open Settings → General Management → Reset → Factory Data Reset
- Tap Reset and confirm
- Allow the device to restart completely
Option 2: Reset from Esper Console
- Go to Devices & Groups → Device Details
- Click Actions → Factory Reset
- Confirm and wait for the device to restart
If your device is enrolled in another MDM: Remove the device from that MDM first, then perform the factory reset.
Step 3: Verify the reset was successful
After the device restarts, confirm that:
- The device boots into the initial setup wizard
- No managed profile indicators appear on the lock screen or status bar
- The ADB output from Step 1 returns no Device Owner packages
Step 4: Re-provision your device
Once the factory reset is complete, restart the Esper provisioning process using your original QR code or provisioning method in the Esper Provisioner app.
Step 5: Confirm successful provisioning
In the Esper Console, verify that your device now appears as Online and Provisioned in Devices & Groups. The provisioning logs should proceed past the "Setting admin privilege to esper agent" step without errors.
If factory reset is not possible
If your device cannot be factory reset but you have ADB access, you can attempt to remove the existing Device Owner directly:
adb shell dpm remove-active-admin <existing.package.name>/.AdminReceiver
Note: This command only works if the existing Device Owner has not disabled ADB or locked down the device.
For devices enrolled in Google Zero-Touch Enrollment (ZTE) or Samsung KME: You must remove the device from the ZTE or KME portal first through the owning organization before provisioning with Esper. A factory reset alone may not clear this enrollment.
Still need help?
If you've completed all the steps above and your device still fails to provision, or if you're unable to factory reset your device, contact Esper Support. include your full provisioner logs and ADB logcat output when submitting your request.
Please sign in to leave a comment.
Comments
0 comments