microsoft / powerplatform-build-tools

Power Platform Build Tools automate common build and deployment tasks related to Power Platform. This includes synchronization of solution metadata (a.k.a. solutions) between development environments and source control, generating build artifacts, deploying to downstream environments, provisioning/de-provisioning of environments, and the ability to perform static analysis checks against your solution using the PowerApps checker service.
MIT License
181 stars 38 forks source link

Self-hosted agent: A specified logon session does not exist. #748

Open bananamufu opened 6 months ago

bananamufu commented 6 months ago

Since the beginning of February all tasks that connect to an environment fail on my self-hosted agents. It's working fine on Azure hosted agents. I tried reinstalling the agent, updating pac cli, renewing the pat and tried a different machine altogether, to no avail.

2024-02-12T16:07:35.6834205Z ==============================================================================
2024-02-12T16:07:35.6834310Z Task         : Power Platform Import Solution
2024-02-12T16:07:35.6834374Z Description  : Power Platform Import Solution
2024-02-12T16:07:35.6834431Z Version      : 2.0.51
2024-02-12T16:07:35.6834477Z Author       : Microsoft
2024-02-12T16:07:35.6834530Z Help         : https://aka.ms/buildtoolsdoc Ideas, feedback: https://github.com/microsoft/powerplatform-build-tools/discussions
2024-02-12T16:07:35.6834621Z ==============================================================================
2024-02-12T16:07:35.8241393Z Discovered environment url from explicit input parameter 'Environment': $(BuildTools.EnvironmentUrl)
2024-02-12T16:07:35.8243891Z Discovered Azure DevOps variable expression that needs resolving: $(BuildTools.EnvironmentUrl) -> BuildTools.EnvironmentUrl
2024-02-12T16:07:35.8250327Z Falling back to url from service connection, using: https://xxx.dynamics.com/
2024-02-12T16:07:35.8267553Z [
2024-02-12T16:07:35.8267837Z   'authN to env. authType:SPN authScheme:None; cloudInstance: Public; envUrl: xxx.crm4.dynamics.com/'
2024-02-12T16:07:35.8267989Z ]
2024-02-12T16:07:42.3866530Z [
2024-02-12T16:07:42.3867263Z   "'***' authenticated successfully."
2024-02-12T16:07:42.3867371Z ]
2024-02-12T16:07:43.2104419Z [
2024-02-12T16:07:43.2105208Z   'Sorry, the app encountered a non recoverable error and will need to terminate. The exception details have been captured and will be forwarded to the development team, if telemetry has been enabled. Exception Id: 943d4bd0-bd27-4ee2-a691-e7e1e51fbf49, Exception Type: System.MissingMethodException'
2024-02-12T16:07:43.2105488Z ]
2024-02-12T16:07:43.2116469Z [
2024-02-12T16:07:43.2116831Z   'The diagnostic logs can be found at: D:\\agent\\_work\\_tasks\\PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3\\2.0.51\\bin\\pac\\tools\\logs\\pac-log.txt'
2024-02-12T16:07:43.2117018Z ]
2024-02-12T16:07:43.3455422Z ##[error]error: 1
2024-02-12T16:07:43.3460709Z ##[error]failed: '***' authenticated successfully.
Sorry, the app encountered a non recoverable error and will need to terminate. The exception details have been captured and will be forwarded to the development team, if telemetry has been enabled. Exception Id: 943d4bd0-bd27-4ee2-a691-e7e1e51fbf49, Exception Type: System.MissingMethodException
The diagnostic logs can be found at: D:\agent\_work\_tasks\PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3\2.0.51\bin\pac\tools\logs\pac-log.txt
2024-02-12T16:07:45.2634863Z [ 'Authentication profiles and token cache removed' ]
2024-02-12T16:07:45.9025917Z [
2024-02-12T16:07:45.9026543Z   'The Clear Authentication Result: Authentication profiles and token cache removed'
2024-02-12T16:07:45.9026955Z ]
2024-02-12T16:07:45.9028486Z ##[error]Error: '***' authenticated successfully.
Sorry, the app encountered a non recoverable error and will need to terminate. The exception details have been captured and will be forwarded to the development team, if telemetry has been enabled. Exception Id: 943d4bd0-bd27-4ee2-a691-e7e1e51fbf49, Exception Type: System.MissingMethodException
The diagnostic logs can be found at: D:\agent\_work\_tasks\PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3\2.0.51\bin\pac\tools\logs\pac-log.txt

pac-log.txt:


2024-02-12 16:00:33.1219 | INF | bolt.Session :: Start new session. (sessionId: ae0a30e8-b64f-4510-bf07-855fd927f756; operationId: 465534d75f61b1d4cac37046caa4e0bf; userId: d2d0e262-093f-484e-b2d4-487f252dfd48; nonInteractiveMode: False)
2024-02-12 16:00:33.2350 | INF | bolt.cli.CommandProcessor :: StartExecutingVerb (Verbs: ["auth","create"])
2024-02-12 16:00:33.2750 | INF | bolt.cli.Verb :: Executing verb 'auth create' with arguments --url,--tenant,--applicationId,--clientSecret,--cloud.
2024-02-12 16:00:33.2850 | INF | bolt.cli.CommandLine.VerbExecutor :: PerformAuthenticationAsync - Getting auth profile with following options: { AuthKind = , IsRequired = False, ShowProfileMessages = False, DisableAutoOSLogin = True, SkipValidation = True }
2024-02-12 16:00:33.2850 | INF | bolt.authentication.profiles.FileBasedAuthProfilesManager :: Auth profiles file not found
2024-02-12 16:00:33.2850 | INF | bolt.cli.CommandLine.VerbExecutor :: PerformAuthenticationAsync - Attempting to use OS login for telemetry purposes only.
2024-02-12 16:00:33.2850 | INF | bolt.authentication.store.AuthTokenStore :: TryCreateAuthProfileFromOperatingSystemAsync: Attempting to create OperatingSystem profile
2024-02-12 16:00:33.3050 | INF | bolt.authentication.store.AuthTokenStore :: CreateUniversalAuthProfile: Acquiring token for https://service.powerapps.com/ using authority https://login.microsoftonline.com/organizations for Public cloud
2024-02-12 16:00:33.4311 | ERR | Microsoft.Identity.Client.IPublicClientApplication :: True MSAL 4.57.0.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2024-02-12 16:00:33Z] [MSAL:0002]   ERROR   ErrorInternalImpl:134   Created an error: 9o4uc, StatusInternal::Unexpected, InternalEvent::None, Error Code -2147023584, Context 'Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.'
2024-02-12 16:00:33.4482 | ERR | Microsoft.Identity.Client.IPublicClientApplication :: True MSAL 4.57.0.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2024-02-12 16:00:33Z - 2bd2ebcd-ae17-4d4a-ae5a-87690faa881d] MSAL.Desktop.4.57.0.0.MsalServiceException: 
    ErrorCode: unknown_broker_error
Microsoft.Identity.Client.MsalServiceException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738)
   at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()
    StatusCode: 0 
    ResponseBody:  
    Headers: 
2024-02-12 16:00:33.4482 | ERR | bolt.authentication.store.AuthTokenStore :: Exception in CreateAuthProfile()|EXCEPTION: MSAL.Desktop.4.57.0.0.MsalServiceException: 
    ErrorCode: unknown_broker_error
Microsoft.Identity.Client.MsalServiceException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738)
   at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStore.<AcquireTokenAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStoreBase.<CreateUniversalAuthProfile>d__9.MoveNext()
    StatusCode: 0 
    ResponseBody:  
    Headers: 
2024-02-12 16:00:33.4482 | WRN | bolt.authentication.store.AuthTokenStore :: TryCreateAuthProfileFromOperatingSystemAsync: Failed to create OperatingSystem profile|EXCEPTION: bolt.system.VerbExecutionException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738) ---> Microsoft.Identity.Client.MsalServiceException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738)
   at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStore.<AcquireTokenAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStoreBase.<CreateUniversalAuthProfile>d__9.MoveNext()
   --- End of inner exception stack trace ---
   at bolt.authentication.store.AuthTokenStoreBase.<CreateUniversalAuthProfile>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStoreBase.<TryCreateAuthProfileFromOperatingSystemAsync>d__8.MoveNext()
MSAL.Desktop.4.57.0.0.MsalServiceException: 
    ErrorCode: unknown_broker_error
Microsoft.Identity.Client.MsalServiceException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738)
   at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStore.<AcquireTokenAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStoreBase.<CreateUniversalAuthProfile>d__9.MoveNext()
    StatusCode: 0 
    ResponseBody:  
    Headers: 
2024-02-12 16:00:34.1676 | INF | bolt.module.auth.AuthModule :: Creating UNIVERSAL auth profile
2024-02-12 16:00:34.1806 | INF | System.Net.Http.HttpClient.PowerPlatformCLI.LogicalHandler :: Start processing HTTP request GET https://xxx.crm4.dynamics.com/api/data/v9
2024-02-12 16:00:34.1806 | INF | System.Net.Http.HttpClient.PowerPlatformCLI.ClientHandler :: Sending HTTP request GET https://xxx.crm4.dynamics.com/api/data/v9
2024-02-12 16:00:38.6365 | INF | System.Net.Http.HttpClient.PowerPlatformCLI.ClientHandler :: Received HTTP response headers after 4446.7943ms - 401
2024-02-12 16:00:38.6365 | INF | System.Net.Http.HttpClient.PowerPlatformCLI.LogicalHandler :: End processing HTTP request after 4462.9956ms - 401
2024-02-12 16:00:38.6365 | INF | bolt.authentication.store.AuthTokenStore :: CreateUniversalAuthProfile: Acquiring token for https://service.powerapps.com/ using authority https://login.microsoftonline.com/960bc629-24d2-4d73-933a-7176c9fa629b/ for Public cloud
2024-02-12 16:00:39.2614 | INF | bolt.authentication.store.AuthTokenStore :: AuthenticationFlow=ClientSecret: Token successfully acquired via AuthenticationFlow.ClientSecret.
2024-02-12 16:00:39.2954 | INF | bolt.authentication.store.AuthTokenStore :: CreateAuthProfile: Successfully acquired a token with scopes: https://service.powerapps.com//.default
2024-02-12 16:00:39.2954 | INF | bolt.module.auth.AuthModule :: AuthProfile created
2024-02-12 16:00:39.5248 | INF | bolt.authentication.store.AuthTokenStore :: PreAuthenticateResource: Successfully pre-acquired a token using profile of type Application for resource https://api.advisor.powerapps.com/ with scopes: https://api.advisor.powerapps.com//.default
2024-02-12 16:00:39.7329 | INF | bolt.authentication.store.AuthTokenStore :: PreAuthenticateResource: Successfully pre-acquired a token using profile of type Application for resource https://globaldisco.crm.dynamics.com/ with scopes: https://globaldisco.crm.dynamics.com//.default
2024-02-12 16:00:39.9022 | INF | bolt.authentication.store.AuthTokenStore :: PreAuthenticateResource: Successfully pre-acquired a token using profile of type Application for resource https://xxx.crm4.dynamics.com/ with scopes: https://xxx.crm4.dynamics.com//.default
2024-02-12 16:00:39.9632 | INF | Microsoft.PowerPlatform.Dataverse.Client.ServiceClient :: Attempting to Connect to Uri https://xxx.crm4.dynamics.com/XRMServices/2011/Organization.svc
2024-02-12 16:00:39.9712 | INF | Microsoft.PowerPlatform.Dataverse.Client.ServiceClient :: Organization Service URI is 'https://xxx.crm4.dynamics.com/XRMServices/2011/Organization.svc'
2024-02-12 16:00:39.9712 | INF | Microsoft.PowerPlatform.Dataverse.Client.ServiceClient :: ConnectAndInitService - Requesting connection to Organization with Dataverse Version: No organization data available
2024-02-12 16:00:39.9932 | INF | bolt.authentication.store.AuthTokenStore :: Successfully acquired a token using profile of type Application for scope 'https://xxx.crm4.dynamics.com//.default'
2024-02-12 16:00:40.0193 | INF | Microsoft.PowerPlatform.Dataverse.Client.ServiceClient :: ConnectAndInitService - Proxy created, total elapsed time: 00:00:00.0472540
2024-02-12 16:00:40.0193 | INF | Microsoft.PowerPlatform.Dataverse.Client.ServiceClient :: Direct Login Process Succeeded - duration 00:00:00.0560583
2024-02-12 16:00:40.3443 | INF | bolt.cli.CommandProcessor :: EndExecutingVerb (Success: False, Execution Time(ms): 103)
2024-02-12 16:00:40.3563 | FTL | bolt.Session :: Method not found: 'System.String Microsoft.Xrm.Sdk.Organization.OrganizationDetail.get_SchemaType()'.|EXCEPTION: System.MissingMethodException: Method not found: 'System.String Microsoft.Xrm.Sdk.Organization.OrganizationDetail.get_SchemaType()'.
   at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.<RefreshInstanceDetails>d__187.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.RefreshInstanceDetails(IOrganizationService dvService, Uri uriOfInstance)
   at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.get_ConnectedOrganizationDetail()
   at bolt.dataverse.client.CdsServiceClient.get_ConnectedOrgFriendlyName()
   at bolt.cli.CdsClientExtensions.ConnectedOrgToSelectedOrganizationInfo(ICdsClient client)
   at bolt.cli.CdsClientConnector.ConnectToEnvironmentImpl(AuthProfile authProfile, Uri environmentUrl, Boolean disableTelemetryAndOutput)
   at bolt.cli.EnvironmentResolver.ResolveOrgDetailsViaDataverseConnection(AuthProfile authProfile, Uri environmentUrl)
   at bolt.cli.EnvironmentResolver.<ResolveEnvironmentLookupSpecAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.module.auth.verbs.AuthCreateVerb.<ResolveSelectedEnvironmentAndValidateConnection>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.module.auth.verbs.AuthCreateVerb.<ExecuteInternalAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.module.auth.verbs.AuthCreateVerb.<ExecuteAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandLine.VerbExecutor.<ExecuteImplAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandLine.VerbExecutor.<>c__DisplayClass8_1.<<ExecuteAsync>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandLine.VerbExecutor.<ExecuteWithTelemetryAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandLine.VerbExecutor.<ExecuteAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.Verb.<>c__DisplayClass11_0.<<RunVerbExecutorAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.Verb.<RunVerbExecutorAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.Verb.<ExecuteWithOutputAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.Verb.<ExecuteAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at bolt.cli.CommandProcessor.<ProcessCommands>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandProcessor.<LaunchCommand>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.ModeManager.<Dispatch>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.Session.<Run>d__14.MoveNext()
2024-02-12 16:00:40.3563 | ERR | bolt.Session ::    at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.<RefreshInstanceDetails>d__187.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.RefreshInstanceDetails(IOrganizationService dvService, Uri uriOfInstance)
   at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.get_ConnectedOrganizationDetail()
   at bolt.dataverse.client.CdsServiceClient.get_ConnectedOrgFriendlyName()
   at bolt.cli.CdsClientExtensions.ConnectedOrgToSelectedOrganizationInfo(ICdsClient client)
   at bolt.cli.CdsClientConnector.ConnectToEnvironmentImpl(AuthProfile authProfile, Uri environmentUrl, Boolean disableTelemetryAndOutput)
   at bolt.cli.EnvironmentResolver.ResolveOrgDetailsViaDataverseConnection(AuthProfile authProfile, Uri environmentUrl)
   at bolt.cli.EnvironmentResolver.<ResolveEnvironmentLookupSpecAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.module.auth.verbs.AuthCreateVerb.<ResolveSelectedEnvironmentAndValidateConnection>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.module.auth.verbs.AuthCreateVerb.<ExecuteInternalAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.module.auth.verbs.AuthCreateVerb.<ExecuteAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandLine.VerbExecutor.<ExecuteImplAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandLine.VerbExecutor.<>c__DisplayClass8_1.<<ExecuteAsync>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandLine.VerbExecutor.<ExecuteWithTelemetryAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandLine.VerbExecutor.<ExecuteAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.Verb.<>c__DisplayClass11_0.<<RunVerbExecutorAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.Verb.<RunVerbExecutorAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.Verb.<ExecuteWithOutputAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.Verb.<ExecuteAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at bolt.cli.CommandProcessor.<ProcessCommands>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.CommandProcessor.<LaunchCommand>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.cli.ModeManager.<Dispatch>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.Session.<Run>d__14.MoveNext()
2024-02-12 16:00:40.3563 | INF | bolt.Session :: End session. (sessionId: ae0a30e8-b64f-4510-bf07-855fd927f756; ResponseCode: 500)

2024-02-12 16:00:40.4524 | INF | Microsoft.PowerPlatform.Tooling.BatchedTelemetry :: BatchedTransmitter`1.StartUploadProcess Started uploader with process id: 13308
2024-02-12 16:00:41.1421 | INF | bolt.Session :: Product Version: 1.30.5+g0bf9504; File Version: 1.30.5
2024-02-12 16:00:41.1651 | INF | bolt.Session :: Start new session. (sessionId: 1c039caf-84a6-44ae-885c-753c8028120c; operationId: 6fdfa7f2d985c0767d3faa2c99652878; userId: d2d0e262-093f-484e-b2d4-487f252dfd48; nonInteractiveMode: False)
2024-02-12 16:00:41.2792 | INF | bolt.cli.CommandProcessor :: StartExecutingVerb (Verbs: ["auth","clear"])
2024-02-12 16:00:41.3052 | INF | bolt.cli.Verb :: Executing verb 'auth clear' with no arguments.
2024-02-12 16:00:41.3162 | INF | bolt.cli.CommandLine.VerbExecutor :: PerformAuthenticationAsync - Getting auth profile with following options: { AuthKind = , IsRequired = False, ShowProfileMessages = False, DisableAutoOSLogin = True, SkipValidation = True }
2024-02-12 16:00:41.3322 | INF | bolt.authentication.profiles.FileBasedAuthProfilesManager :: Auth profiles file not found
2024-02-12 16:00:41.3322 | INF | bolt.cli.CommandLine.VerbExecutor :: PerformAuthenticationAsync - Attempting to use OS login for telemetry purposes only.
2024-02-12 16:00:41.3322 | INF | bolt.authentication.store.AuthTokenStore :: TryCreateAuthProfileFromOperatingSystemAsync: Attempting to create OperatingSystem profile
2024-02-12 16:00:41.3462 | INF | bolt.authentication.store.AuthTokenStore :: CreateUniversalAuthProfile: Acquiring token for https://service.powerapps.com/ using authority https://login.microsoftonline.com/organizations for Public cloud
2024-02-12 16:00:41.4679 | ERR | Microsoft.Identity.Client.IPublicClientApplication :: True MSAL 4.57.0.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2024-02-12 16:00:41Z] [MSAL:0002]   ERROR   ErrorInternalImpl:134   Created an error: 9o4uc, StatusInternal::Unexpected, InternalEvent::None, Error Code -2147023584, Context 'Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.'
2024-02-12 16:00:41.4849 | ERR | Microsoft.Identity.Client.IPublicClientApplication :: True MSAL 4.57.0.0 MSAL.Desktop 4.8 or later Windows 10 Pro [2024-02-12 16:00:41Z - cff497b0-6681-48ff-8e23-0e7efd1b3292] MSAL.Desktop.4.57.0.0.MsalServiceException: 
    ErrorCode: unknown_broker_error
Microsoft.Identity.Client.MsalServiceException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738)
   at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()
    StatusCode: 0 
    ResponseBody:  
    Headers: 
2024-02-12 16:00:41.4849 | ERR | bolt.authentication.store.AuthTokenStore :: Exception in CreateAuthProfile()|EXCEPTION: MSAL.Desktop.4.57.0.0.MsalServiceException: 
    ErrorCode: unknown_broker_error
Microsoft.Identity.Client.MsalServiceException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738)
   at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStore.<AcquireTokenAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStoreBase.<CreateUniversalAuthProfile>d__9.MoveNext()
    StatusCode: 0 
    ResponseBody:  
    Headers: 
2024-02-12 16:00:41.4889 | WRN | bolt.authentication.store.AuthTokenStore :: TryCreateAuthProfileFromOperatingSystemAsync: Failed to create OperatingSystem profile|EXCEPTION: bolt.system.VerbExecutionException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738) ---> Microsoft.Identity.Client.MsalServiceException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738)
   at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStore.<AcquireTokenAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStoreBase.<CreateUniversalAuthProfile>d__9.MoveNext()
   --- End of inner exception stack trace ---
   at bolt.authentication.store.AuthTokenStoreBase.<CreateUniversalAuthProfile>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStoreBase.<TryCreateAuthProfileFromOperatingSystemAsync>d__8.MoveNext()
MSAL.Desktop.4.57.0.0.MsalServiceException: 
    ErrorCode: unknown_broker_error
Microsoft.Identity.Client.MsalServiceException: Unknown Status: Unexpected
Error: 0xffffffff80070520
Context: Winrt exception was thrown during GetTokenSilently 'A specified logon session does not exist. It may already have been terminated.'.
Tag: 0x2339e502 (error code -2147023584) (internal error code 590996738)
   at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStore.<AcquireTokenAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at bolt.authentication.store.AuthTokenStoreBase.<CreateUniversalAuthProfile>d__9.MoveNext()
    StatusCode: 0 
    ResponseBody:  
    Headers: 
2024-02-12 16:00:42.5950 | INF | bolt.authentication.store.ServicePrincipalCache :: Clearing service principal cache
2024-02-12 16:00:42.5960 | INF | bolt.authentication.store.ServicePrincipalCache :: Initializing service principal cache
2024-02-12 16:00:42.5960 | INF | bolt.authentication.profiles.FileBasedAuthProfilesManager :: Clear(): Deleting token cache
2024-02-12 16:00:42.9464 | INF | bolt.cli.CommandProcessor :: EndExecutingVerb (Success: True, Execution Time(ms): 660)
2024-02-12 16:00:42.9464 | INF | bolt.Session :: End session. (sessionId: 1c039caf-84a6-44ae-885c-753c8028120c; ResponseCode: 200)

2024-02-12 16:00:43.0411 | INF | Microsoft.PowerPlatform.Tooling.BatchedTelemetry :: BatchedTransmitter`1.StartUploadProcess Started uploader with process id: 14908```
bananamufu commented 6 months ago

Any help on this?

tehcrashxor commented 5 months ago

While "A specified logon session does not exist" is appearing in your logs, that is not the issue. Those exceptions are logged and caught, but not cancelling the task.

The actual issue occurring is from this section of the logs:

2024-02-12 16:00:40.3563 | FTL | bolt.Session :: Method not found: 'System.String Microsoft.Xrm.Sdk.Organization.OrganizationDetail.get_SchemaType()'.|EXCEPTION: System.MissingMethodException: Method not found: 'System.String Microsoft.Xrm.Sdk.Organization.OrganizationDetail.get_SchemaType()'.
   at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.<RefreshInstanceDetails>d__187.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.RefreshInstanceDetails(IOrganizationService dvService, Uri uriOfInstance)
   at Microsoft.PowerPlatform.Dataverse.Client.ConnectionService.get_ConnectedOrganizationDetail()
   at bolt.dataverse.client.CdsServiceClient.get_ConnectedOrgFriendlyName()

System.MissingMethodException typically indicates a version mismatch between .dll files.
Historically, this issue has happened most often when either old versions of CRM or other tooling would register assemblies in the machine's GAC (Global Assembly Cache), so you may want to check if your self-hosted agent has Microsoft.Xrm.Sdk.dll registered there.