question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DeadObjectException & TransactionTooLargeException on devices with Broker app

See original GitHub issue

Describe the bug Yammer is migrating from ADAL to MSAL. Silent AcquireToken requests succeed when the device has no broker app installed. Found exceptions in the logs when trying silent AcquireToken on a device with the Microsoft Authenticator app installed

Smartphone (please complete the following information):

  • Device: Pixel3 XL
  • Android Version: API version 30, Android 10
  • Browser: Chrome android
  • MSAL Version: 1.3.0

Stacktrace

android.accounts.AuthenticatorException: addAccount failed

        at android.accounts.AccountManager.convertErrorToException(AccountManager.java:2558)
        at android.accounts.AccountManager.access$700(AccountManager.java:162)
        at android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.java:2394)
        at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:107)
        at android.os.Binder.execTransactInternal(Binder.java:1021)
        at android.os.Binder.execTransact(Binder.java:994)
   android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(BinderProxy.java:511)
        at com.microsoft.identity.client.IMicrosoftAuthService$Stub$Proxy.getAccounts(IMicrosoftAuthService.java:269)
        at com.microsoft.identity.client.internal.controllers.BrokerAuthServiceStrategy$4.perform(BrokerAuthServiceStrategy.java:225)
        at com.microsoft.identity.client.internal.controllers.BrokerAuthServiceStrategy$4.perform(BrokerAuthServiceStrategy.java:220)
        at com.microsoft.identity.client.internal.controllers.BrokerAuthServiceStrategy.performAuthServiceOperation(BrokerAuthServiceStrategy.java:119)
        at com.microsoft.identity.client.internal.controllers.BrokerAuthServiceStrategy.getBrokerAccounts(BrokerAuthServiceStrategy.java:219)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController$3.perform(BrokerMsalController.java:348)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController$3.perform(BrokerMsalController.java:344)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController.invokeBrokerOperation(BrokerMsalController.java:196)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController.getAccounts(BrokerMsalController.java:343)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController.getCurrentAccount(BrokerMsalController.java:433)
        at com.microsoft.identity.common.internal.controllers.GetCurrentAccountCommand.execute(GetCurrentAccountCommand.java:66)
        at com.microsoft.identity.common.internal.controllers.GetCurrentAccountCommand.execute(GetCurrentAccountCommand.java:37)
        at com.microsoft.identity.common.internal.controllers.CommandDispatcher.executeCommand(CommandDispatcher.java:138)
        at com.microsoft.identity.common.internal.controllers.CommandDispatcher.access$200(CommandDispatcher.java:53)
        at com.microsoft.identity.common.internal.controllers.CommandDispatcher$1.run(CommandDispatcher.java:95)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
    android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(BinderProxy.java:511)
        at com.microsoft.identity.client.IMicrosoftAuthService$Stub$Proxy.getAccounts(IMicrosoftAuthService.java:269)
        at com.microsoft.identity.client.internal.controllers.BrokerAuthServiceStrategy$4.perform(BrokerAuthServiceStrategy.java:225)
        at com.microsoft.identity.client.internal.controllers.BrokerAuthServiceStrategy$4.perform(BrokerAuthServiceStrategy.java:220)
        at com.microsoft.identity.client.internal.controllers.BrokerAuthServiceStrategy.performAuthServiceOperation(BrokerAuthServiceStrategy.java:119)
        at com.microsoft.identity.client.internal.controllers.BrokerAuthServiceStrategy.getBrokerAccounts(BrokerAuthServiceStrategy.java:219)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController$3.perform(BrokerMsalController.java:348)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController$3.perform(BrokerMsalController.java:344)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController.invokeBrokerOperation(BrokerMsalController.java:196)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController.getAccounts(BrokerMsalController.java:343)
        at com.microsoft.identity.client.internal.controllers.BrokerMsalController.getCurrentAccount(BrokerMsalController.java:433)
        at com.microsoft.identity.common.internal.controllers.GetCurrentAccountCommand.execute(GetCurrentAccountCommand.java:66)
        at com.microsoft.identity.common.internal.controllers.GetCurrentAccountCommand.execute(GetCurrentAccountCommand.java:37)
        at com.microsoft.identity.common.internal.controllers.CommandDispatcher.executeCommand(CommandDispatcher.java:138)
        at com.microsoft.identity.common.internal.controllers.CommandDispatcher.access$200(CommandDispatcher.java:53)
        at com.microsoft.identity.common.internal.controllers.CommandDispatcher$1.run(CommandDispatcher.java:95)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)



2020-03-16 15:59:05.906 27523-27540/? W/AccountAuthenticator: addAccount(com.microsoft.workaccount)
    android.os.TransactionTooLargeException: data parcel size 2830992 bytes
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(BinderProxy.java:511)
        at android.accounts.IAccountAuthenticatorResponse$Stub$Proxy.onResult(IAccountAuthenticatorResponse.java:156)
        at android.accounts.AbstractAccountAuthenticator$Transport.addAccount(AbstractAccountAuthenticator.java:176)
        at android.accounts.IAccountAuthenticator$Stub.onTransact(IAccountAuthenticator.java:236)
        at android.os.Binder.execTransactInternal(Binder.java:1021)
        at android.os.Binder.execTransact(Binder.java:994)
2020-03-16 15:59:05.915 28489-28537/com.yammer.v1.debug E/BrokerAccountManagerStrategy:getBrokerAccountsWithAccountManager:  [2020-03-16 10:29:05 - {"thread_id":"12313","correlation_id":"e1892da9-5a95-4b50-af27-c067e8a4fc25"}] addAccount failed Android 29
    android.accounts.AuthenticatorException: addAccount failed
        at android.accounts.AccountManager.convertErrorToException(AccountManager.java:2558)
        at android.accounts.AccountManager.access$700(AccountManager.java:162)
        at android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.java:2394)
        at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:107)
        at android.os.Binder.execTransactInternal(Binder.java:1021)
        at android.os.Binder.execTransact(Binder.java:994)
2020-03-16 15:59:05.919 28489-30268/com.yammer.v1.debug E/AuthCallbackUtils: App's acquireToken callback threw an exception.
    com.microsoft.identity.client.exception.MsalClientException: MSAL failed to communicate to Broker.
        at com.microsoft.identity.client.internal.controllers.MsalExceptionAdapter.msalExceptionFromBaseException(MsalExceptionAdapter.java:82)
        at com.microsoft.identity.client.SingleAccountPublicClientApplication$1.onError(SingleAccountPublicClientApplication.java:122)
        at com.microsoft.identity.client.SingleAccountPublicClientApplication$1.onError(SingleAccountPublicClientApplication.java:111)
        at com.microsoft.identity.common.internal.controllers.CommandDispatcher$2.run(CommandDispatcher.java:177)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)`

To Reproduce Steps to reproduce the behavior:

  • Microsoft Authenticator as the broker app

  • Perform acquireTokenSilent() using MSAL

If related to user experience, use the format:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

If related to development, please provide relevant configuration details necessary to understand your problem including any relevant traces, logs, or otherwise. The exception is seen when getAccounts() is called on a MultipleAccountPublicClientApplication

In our config file, we have  and redirect_uri as 
"broker_redirect_uri_registered": true

Expected behavior Account migration should be done successfully

Actual Behavior Exception is thrown

Please note: Do not include sensitive information like PII, OII, credentials, secrets, and tokens.

For privacy/security issues please see instructions here

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
iambmeltcommented, Apr 9, 2020

Synced offline and provided new build with caching fixes.

1reaction
iambmeltcommented, Mar 19, 2020

@shoatman @shahzaibj - This looks related to the logs attached (not in the description) to this work item (corpnet required): https://domoreexp.visualstudio.com/DefaultCollection/MSTeams/_workitems/edit/786557

@prmeno Is there more to these logs? Perhaps more detailed repro steps?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do on TransactionTooLargeException - Stack Overflow
My app is running on a quad core 1.6 GHz device and uses 3 threads for heavylifting ... TransactionTooLargeException is a checked exception,...
Read more >
All Android Versions & Devices | Page 293 | XDA Forums
I am trying to updating the Google Play Services of my phone, so that a newer version is available even when wiping the...
Read more >
BackupAgentHelper - Android Developers
An application will typically extend this class in its own backup agent. ... String) to retrieve a CameraManager for interacting with camera devices....
Read more >
Android build crashes on launch. - Unity Answers
We've been working to get our Unity application onto an android tablet in the office and we're encountering an issue that I'm not...
Read more >
Diff - platform/frameworks/base - Google Git
AutomaticZenRule addAutomaticZenRule(android.app. ... Enumeration<V> elements(); method public java.util. ... DeadObjectException; import android.os.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found