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.

[Bug] The same command was already received and is being processed.

See original GitHub issue

Logs and network traces

Info	16-7-2021 15:39:10 +02:00	MsAuthStartActivity	[OnCreate:93]Start sign in. Reason: app started
Debug	16-7-2021 15:39:10 +02:00	MsAuthStartActivity	[StartSignIn:126]MijnOmgeving is not installed
Debug	16-7-2021 15:39:10 +02:00	AzureAdAuthenticationContext	[SetContext:40]Setting context: ComponentInfo{nl.servicewal/md5e028ef4bf28caaffe48d2e3e854927ae.StartActivity}
Info	16-7-2021 15:39:10 +02:00	MsAuthStartActivity	[SignInForEnvironmentAsync:170]Sign in for environment Productie
Debug	16-7-2021 15:39:10 +02:00	AzureAdAuthenticationContext	[SetContext:40]Setting context: ComponentInfo{nl.servicewal/md5e028ef4bf28caaffe48d2e3e854927ae.StartActivity}
Info	16-7-2021 15:39:10 +02:00	AzureAdAuthService	[SignInAsync:52]Attempting to sign in silently
Debug	16-7-2021 15:39:10 +02:00	AzureAdAuthService	[RequestTokenSilentWithTimeoutAsync:78]Starting silent token request
Debug	16-7-2021 15:39:10 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:112]Request silent token has username: True and with scopes: *** edited: SCOPE 2 ***
Debug	16-7-2021 15:39:10 +02:00	MsAuthStartActivity	[OnActivityResult:353]Activity returned: [RequestCode: 1200][ResultCode: Canceled]
Info	16-7-2021 15:39:10 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:119]Silent sign in started
Debug	16-7-2021 15:39:10 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:166]Request silent token with TokenSource: Cache
Debug	16-7-2021 15:39:10 +02:00	AzureAdAuthService	[RequestTokenSilentWithTimeoutAsync:108]Finished silent token request
Info	16-7-2021 15:39:10 +02:00	AzureAdAuthService	[SignInAsync:56]Silent sign in success.
Debug	16-7-2021 15:39:10 +02:00	MsAuthStartActivity	[SignInForEnvironmentAsync:181]Go to main activity, the user logged in
Info	16-7-2021 15:39:10 +02:00	MsAuthStartActivity	[SignInForEnvironmentAsync:253]SignInForEnvironmentAsync finished
Info	16-7-2021 15:39:10 +02:00	AzureAdAuthService	[SignInAsync:52]Attempting to sign in silently
Debug	16-7-2021 15:39:10 +02:00	AzureAdAuthService	[RequestTokenSilentWithTimeoutAsync:78]Starting silent token request
Debug	16-7-2021 15:39:10 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:112]Request silent token has username: True and with scopes: *** edited: SCOPE 1 ***
Info	16-7-2021 15:39:10 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:119]Silent sign in started
Warning	16-7-2021 15:39:10 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Warning (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 26 [07/16/2021 13:39:10 - ] Refreshing the RT failed. Is AAD down? False. Is there an AT in the cache that is usable? False 
Warning	16-7-2021 15:39:10 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Warning (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 26 [07/16/2021 13:39:10 - ] Failed to refresh the RT and cannot use existing AT (expired or missing). 
Debug	16-7-2021 15:39:11 +02:00	AzureAdAuthenticationContext	[SetContext:40]Setting context: ComponentInfo{nl.servicewal/crc64d0f81eb6dd67911c.ServiceWalActivity}
Info	16-7-2021 15:39:11 +02:00	AzureAdAuthService	[SignInAsync:52]Attempting to sign in silently
Debug	16-7-2021 15:39:11 +02:00	AzureAdAuthService	[RequestTokenSilentWithTimeoutAsync:78]Starting silent token request
Debug	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:112]Request silent token has username: True and with scopes: *** edited: SCOPE 2 ***
Info	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:119]Silent sign in started
Info	16-7-2021 15:39:11 +02:00	AzureAdAuthService	[SignInAsync:52]Attempting to sign in silently
Debug	16-7-2021 15:39:11 +02:00	AzureAdAuthService	[RequestTokenSilentWithTimeoutAsync:78]Starting silent token request
Debug	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:112]Request silent token has username: True and with scopes: *** edited: SCOPE 1 ***
Info	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:119]Silent sign in started
Warning	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Warning (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 26 [07/16/2021 13:39:11 - ] Refreshing the RT failed. Is AAD down? False. Is there an AT in the cache that is usable? False 
Warning	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Warning (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 26 [07/16/2021 13:39:11 - ] Failed to refresh the RT and cannot use existing AT (expired or missing). 
Debug	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[RequestTokenSilentAsync:166]Request silent token with TokenSource: Cache
Debug	16-7-2021 15:39:11 +02:00	AzureAdAuthService	[RequestTokenSilentWithTimeoutAsync:108]Finished silent token request
Info	16-7-2021 15:39:11 +02:00	AzureAdAuthService	[SignInAsync:56]Silent sign in success.
Warning	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Warning (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 26 [07/16/2021 13:39:11] [Android broker] Silent call failed. This usually means that the RT cannot be refreshed and interaction is required. BundleResult: Bundle[{broker_result_v2={"cached_at":0,"broker_error_code":"duplicate_command","broker_error_message":"The same command was already received and is being processed.","broker_exception_type":"com.microsoft.identity.common.exception.ClientException","expires_on":0,"ext_expires_on":0,"http_response_code":0,"serviced_from_cache":false,"success":false}, broker_request_v2_success=false}] Result string: {"cached_at":0,"broker_error_code":"duplicate_command","broker_error_message":"The same command was already received and is being processed.","broker_exception_type":"com.microsoft.identity.common.exception.ClientException","expires_on":0,"ext_expires_on":0,"http_response_code":0,"serviced_from_cache":false,"success":false}
Error	16-7-2021 15:39:11 +02:00	AzureAdAuthTokenProvider	[MsalLoggingCallback:195]MSAL: Error (False) MSAL 4.30.1.0 MSAL.Xamarin.Android 26 [07/16/2021 13:39:11 - ] Exception type: Microsoft.Identity.Client.MsalServiceException
, ErrorCode: duplicate_command
HTTP StatusCode 0
CorrelationId 

  at Microsoft.Identity.Client.Internal.Requests.BrokerSilentStrategy.ValidateResponseFromBroker (Microsoft.Identity.Client.OAuth2.MsalTokenResponse msalTokenResponse) [0x000d3] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.BrokerSilentStrategy.SendTokenRequestToBrokerAsync () [0x0013a] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.BrokerSilentStrategy.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00079] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00235] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync (System.Threading.CancellationToken cancellationToken) [0x000fb] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
Error	16-7-2021 15:39:11 +02:00	MsalServiceException	[RequestTokenSilentAsync:132]MSAL.Xamarin.Android.4.30.1.0.MsalServiceException: 
	ErrorCode: duplicate_command
Microsoft.Identity.Client.MsalServiceException: Broker response returned error: The same command was already received and is being processed.
  at Microsoft.Identity.Client.Internal.Requests.BrokerSilentStrategy.ValidateResponseFromBroker (Microsoft.Identity.Client.OAuth2.MsalTokenResponse msalTokenResponse) [0x000d3] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.BrokerSilentStrategy.SendTokenRequestToBrokerAsync () [0x0013a] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.BrokerSilentStrategy.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00079] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00235] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync (System.Threading.CancellationToken cancellationToken) [0x0016a] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.ExecuteAsync (Microsoft.Identity.Client.ApiConfig.Parameters.AcquireTokenCommonParameters commonParameters, Microsoft.Identity.Client.ApiConfig.Parameters.AcquireTokenSilentParameters silentParameters, System.Threading.CancellationToken cancellationToken) [0x000d5] in <4b3e46bb0945484e8c26e9b1d61cef82>:0 
  at Ns.Orp.Auth.AzureAd.Droid.Services.AzureAdAuthTokenProvider.RequestTokenSilentAsync (System.Collections.Generic.IEnumerable`1[T] scopes, Microsoft.Identity.Client.IAccount account, System.Threading.CancellationToken cancellationToken) [0x0008e] in <a390da5a228e401b980a0a3228d09177>:0 
  at Ns.Orp.Auth.AzureAd.Droid.Services.AzureAdAuthTokenProvider.RequestTokenSilentAsync (System.Collections.Generic.IEnumerable`1[T] scopes, System.String username, System.Threading.CancellationToken cancellationToken) [0x0016b] in <a390da5a228e401b980a0a3228d09177>:0 
	StatusCode: 0 
	ResponseBody:  
	Headers: 

Which version of MSAL.NET are you using? 4.30.1

Platform Xamarin.Android

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Authentication
    • Username Password
    • Device code flow (browserless)
  • Web app
    • Authorization code
    • On-Behalf-Of
  • Daemon app
    • Service to Service calls

Is this a new or existing app? b. The app is in production, I haven’t upgraded MSAL, but started seeing this issue.

Repro We have several mobile apps that use Authenticator as a broker. We experience that some of our users unexpectedly have to log in again (interactive flow) for unknown reasons. One of the errors we see in the logging is: “Microsoft.Identity.Client.MsalServiceException: Broker response returned error: The same command was already received and is being processed."

Expected behavior We expect that the user will only have to log in interactively after a password change.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bgavrilMScommented, Aug 25, 2021

I wonder if this is really an external issue. Seems like you cannot call AcquireTokenSilent several times when talking to Authenticator. I think in MSAL we can add a semaphore around this.

1reaction
michel-doumacommented, Jul 28, 2021

The workaround seems to do the trick. Hope you will fix it soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The same command was already received and is being ...
Describe the bug. In this app I have the authentication set up so that the current access token is added to the request...
Read more >
Error (The seeding operation failed) when running Add- ...
In Microsoft Exchange Server 2019, 2016, or 2013, you run the Add-MailboxDatabaseCopy cmdlet to copy a mailbox database from one mailbox ...
Read more >
Email Security Cloud Gateway - Mimecast SMTP Error Codes
This guide describes the common SMTP error codes that customer encounter on the system.
Read more >
How do I resolve the "java.net.BindException: Address ...
You will get your Process Id (PID), Now to kill the same process run this command: taskkill /pid yourid /f. enter image description...
Read more >
Privilege escalation with polkit: How to get root on Linux ...
The vulnerability enables an unprivileged local user to get a root shell on the system. It's easy to exploit with a few standard...
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