WikiTransformationProject / wikitraccs-releases

Releases, issues and discussions for WikiTraccs from the Wiki Transformation Project
https://www.wikitransformationproject.com
10 stars 1 forks source link

[Bug] MsalServiceException: ErrorCode: request_timeout on Leaving CreatePnPContext #68

Closed PretoPlasma closed 1 year ago

PretoPlasma commented 1 year ago

Is there an existing issue for this?

Current Behavior

When starting wikitraccs.console.exe based on a configured appsettings.json the console ends with: [020 14:41:25 DBG ] Entering CreatePnPContext... | WikiTraccs.Shared.Stores.SPO.PnPContextFactory [020 14:48:08 DBG ] Leaving CreatePnPContext... | WikiTraccs.Shared.Stores.SPO.PnPContextFactory [020 14:48:08 ERR ] [https://CONFLUENCESERVER:8443] Unhandled exception in subscription of AttachToRequestPipeline->scanRequestObservable | WikiTraccs.Console.ConfluenceMonitors.ConfluencePermissionRetriever MSAL.NetCore.4.36.1.0.MsalServiceException: ErrorCode: request_timeout Microsoft.Identity.Client.MsalServiceException: Request to the endpoint timed out.

Expected Behavior

The transformation begins and the confluence space ist going to be created in sharepoint site.

WikiTraccs Version

v1.6.6

Confluence Version

Confluence 7

Relevant log output or page storage format

[012 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443/] Detected successful login to Confluence (auth mode: cookie) | WikiTraccs.Shared.Automation.ConfluenceSessionIdRetriever
[012 14:41:25 DBG  ] Registering token with type Cookie for user 8ab9e521860bc56501860c32a15e0002 in tenant https://CONFLUENCESERVER:8443/ | WikiTraccs.Shared.ConfluenceTokenRetrieval.ConfluenceTokenStore
[007 14:41:25 DBG  ] DONE: Collecting and renewing tokens from auto-logins | WikiTraccs.Shared.ConfluenceTokenRetrieval.ConfluenceTokenStore
[007 14:41:25 DBG  ] Updating tenant list from 1 tokens... | WikiTraccs.Shared.ConfluenceTokenRetrieval.ConfluenceTokenStore
[010 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443/] Start: Retrieving tenants for user 8ab9~0002... | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceGlobalApiAccessor
[010 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443/] Calling 'rest/api/user/current' to retrieve current user info | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceGlobalApiAccessor
[010 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443/] Got tenant list for user 8ab9~0002: 1 | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceGlobalApiAccessor
[010 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443/] Got current user info type: known | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceGlobalApiAccessor
[010 14:41:25 INF  ] Updating known tenant list with tenants: ["Name: https://CONFLUENCESERVER:8443 (ID: https://CONFLUENCESERVER:8443)"] | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceGlobalApiAccessor
[010 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443/] Done: Retrieving tenants for user 8ab9~0002 | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceGlobalApiAccessor
[010 14:41:25 DBG  ] DONE: Updating tenant list; found data contexts: 1 | WikiTraccs.Shared.ConfluenceTokenRetrieval.ConfluenceTokenStore
[010 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443] Sending token renewal request for tenant | WikiTraccs.Shared.ConfluenceTokenRetrieval.ConfluenceTokenStore
[020 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443] Got retrieval request for tenant from stream (reason: 'calling from TokenStore_OnTokenRenewalFinished') | WikiTraccs.Console.ConfluenceMonitors.ConfluencePermissionRetriever
[019 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443] Got retrieval request for tenant from stream (reason: 'calling from TokenStore_OnTokenRenewalFinished') | WikiTraccs.Console.ConfluenceMonitors.ConfluenceContentRetriever
[020 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443] Entering EnqueueRetrievalAsync for tenant ("Full" mode) | 'https://CONFLUENCESERVER:8443' | User 8ab9e521860bc56501860c32a15e0002 (known) | WikiTraccs.Console.ConfluenceMonitors.ConfluencePermissionRetriever
[019 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443] Entering EnqueueRetrievalAsync for tenant ("Full" mode) | 'https://CONFLUENCESERVER:8443' | User 8ab9e521860bc56501860c32a15e0002 (known) | WikiTraccs.Console.ConfluenceMonitors.ConfluenceContentRetriever
[020 14:41:25 DBG  ] [IPC] Creating context "ef25c11c-958c-415a-a286-d6ff2658793a" | WikiTraccs.Shared.Ipc.PipeIpc`1[[WikiTraccs.Shared.Interfaces.ProgressRecord, WikiTraccs.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
[020 14:41:25 DBG  ] [IPC] Starting send timer for "ef25c11c-958c-415a-a286-d6ff2658793a" | WikiTraccs.Shared.Ipc.PipeIpc`1[[WikiTraccs.Shared.Interfaces.ProgressRecord, WikiTraccs.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
[020 14:41:25 DBG  ] [IPC] Starting up new sender context "ef25c11c-958c-415a-a286-d6ff2658793a" | WikiTraccs.Shared.Ipc.PipeIpc`1[[WikiTraccs.Shared.Interfaces.ProgressRecord, WikiTraccs.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
[020 14:41:25 INF  ] [IPC] Starting server for pipe 'WikiTraccs_GlobalStateManager' | WikiTraccs.Shared.Ipc.PipeIpc`1[[WikiTraccs.Shared.Interfaces.ProgressRecord, WikiTraccs.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
[020 14:41:25 DBG  ] [IPC] Starting send timer for "ef25c11c-958c-415a-a286-d6ff2658793a" | WikiTraccs.Shared.Ipc.PipeIpc`1[[WikiTraccs.Shared.Interfaces.ProgressRecord, WikiTraccs.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
[007 14:41:25 DBG  ] [IPC] Sender "ef25c11c-958c-415a-a286-d6ff2658793a" got connection | WikiTraccs.Shared.Ipc.PipeIpc`1[[WikiTraccs.Shared.Interfaces.ProgressRecord, WikiTraccs.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
[020 14:41:25 DBG  ] [https://CONFLUENCESERVER:8443] Checking that destination SharePoint site is prepared... | WikiTraccs.Shared.Stores.SPO.SpoWikiTraccsStore
[020 14:41:25 DBG  ] Entering CreatePnPContext... | WikiTraccs.Shared.Stores.SPO.PnPContextFactory
[020 14:48:08 DBG  ] Leaving CreatePnPContext... | WikiTraccs.Shared.Stores.SPO.PnPContextFactory
[020 14:48:08 ERR  ] [https://CONFLUENCESERVER:8443] Unhandled exception in subscription of AttachToRequestPipeline->scanRequestObservable | WikiTraccs.Console.ConfluenceMonitors.ConfluencePermissionRetriever
MSAL.NetCore.4.36.1.0.MsalServiceException: 
    ErrorCode: request_timeout
Microsoft.Identity.Client.MsalServiceException: Request to the endpoint timed out.
---> System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
---> System.TimeoutException: A task was canceled.
---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at PnP.Framework.Http.RetryHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /_/src/lib/PnP.Framework/Http/RetryHandler.cs:line 106
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Microsoft.Identity.Client.Http.HttpManager.ExecuteAsync(Uri endpoint, IDictionary`2 headers, HttpContent body, HttpMethod method, ICoreLogger logger, CancellationToken cancellationToken)
   at Microsoft.Identity.Client.Http.HttpManager.ExecuteWithRetryAsync(Uri endpoint, IDictionary`2 headers, HttpContent body, HttpMethod method, ICoreLogger logger, Boolean doNotThrow, Boolean retry, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.Identity.Client.Http.HttpManager.ExecuteWithRetryAsync(Uri endpoint, IDictionary`2 headers, HttpContent body, HttpMethod method, ICoreLogger logger, Boolean doNotThrow, Boolean retry, CancellationToken cancellationToken)
   at Microsoft.Identity.Client.Http.HttpManager.ExecuteWithRetryAsync(Uri endpoint, IDictionary`2 headers, HttpContent body, HttpMethod method, ICoreLogger logger, Boolean doNotThrow, Boolean retry, CancellationToken cancellationToken)
   at Microsoft.Identity.Client.Http.HttpManager.SendGetAsync(Uri endpoint, IDictionary`2 headers, ICoreLogger logger, Boolean retry, CancellationToken cancellationToken)
   at Microsoft.Identity.Client.WsTrust.WsTrustWebRequestManager.GetUserRealmAsync(String userRealmUriPrefix, String userName, RequestContext requestContext)
   at Microsoft.Identity.Client.WsTrust.CommonNonInteractiveHandler.QueryUserRealmDataAsync(String userRealmUriPrefix, String username)
   at Microsoft.Identity.Client.Internal.Requests.UsernamePasswordRequest.FetchAssertionFromWsTrustAsync()
   at Microsoft.Identity.Client.Internal.Requests.UsernamePasswordRequest.ExecuteAsync(CancellationToken cancellationToken)
   at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancellationToken)
   at Microsoft.Identity.Client.ApiConfig.Executors.PublicClientExecutor.ExecuteAsync(AcquireTokenCommonParameters commonParameters, AcquireTokenByUsernamePasswordParameters usernamePasswordParameters, CancellationToken cancellationToken)
   at PnP.Framework.AuthenticationManager.GetContextAsync(String siteUrl, CancellationToken cancellationToken) in /_/src/lib/PnP.Framework/AuthenticationManager.cs:line 876
   at PnP.Framework.AuthenticationManager.GetContext(String siteUrl) in /_/src/lib/PnP.Framework/AuthenticationManager.cs:line 827
   at WikiTraccs.Shared.Stores.SPO.PnPPowerShellExtract.PnPConnection.CreateWithCredentials(Uri url, NetworkCredential credentials, Boolean currentCredentials, String tenantAdminUrl, AzureEnvironment azureEnvironment, String clientId, String redirectUrl, Boolean onPrem, InitializationType initializationType) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/PnPPowerShellExtract/PnPConnection.cs:line 284
   at WikiTraccs.Shared.Stores.SPO.PnPPowerShellExtract.ConnectOnline.Or20152m5D(NetworkCredential  , InitializationType  ) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/PnPPowerShellExtract/PnPCredentialManager.cs:line 276
   at WikiTraccs.Shared.Stores.SPO.PnPPowerShellExtract.ConnectOnline.Connect(CancellationToken& cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/PnPPowerShellExtract/PnPCredentialManager.cs:line 117
   at WikiTraccs.Shared.Stores.SPO.PnPPowerShellExtract.ConnectOnline.ProcessRecord()
   at WikiTraccs.Shared.Stores.SPO.PnPContextFactory.CreatePnPContext(TransformationContext trafoCtx) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/SpaceInventoryItem.cs:line 5
   at WikiTraccs.Shared.Stores.SPO.SpoStoreBase.EnsureInitAsync(TransformationContext trafoCtx, Boolean forceNew) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/SpoStoreBase.cs:line 511
   at WikiTraccs.Shared.Stores.SPO.SpoWikiTraccsStore.jmXcNEG8iJ(TransformationContext  , CancellationToken  ) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/SpoWikiTraccsStore.cs:line 164
   at WikiTraccs.Shared.Stores.SPO.SpoWikiTraccsStore.GetPreparationStateAsync(TransformationContext trafoCtx, CancellationToken cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/SpoWikiTraccsStore.cs:line 29
   at WikiTraccs.Shared.Stores.SPO.SpoStoreBase.EnsureSitePreparation(TransformationContext trafoCtx, Func`1 shallPrepareCallback, Boolean throwOnFailure, CancellationToken cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/SpoStoreBase.cs:line 460
   at WikiTraccs.Shared.Stores.SPO.SpoStoreBase.EnsureSiteIsPrepared(TransformationContext trafoCtx, CancellationToken cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/SpoStoreBase.cs:line 79
   at WikiTraccs.Shared.Stores.SPO.SpoWikiTraccsStore.GetSpaceInventoryForTenantAsync(TransformationContext trafoCtx, Boolean onlyWithTrafoRequest, CancellationToken cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/TransformedPageInfo.cs:line 21
   at WikiTraccs.Shared.Registries.WikiTraccsRegistry.GetSpaceInventoryForTenantAsync(TransformationContext trafoCtx, Boolean onlyWithTrafoRequest, Boolean ignoreCache, CancellationToken cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Registries/WikiTraccsRegistry.cs:line 102
   at WikiTraccs.Console.ConfluenceMonitors.ConfluencePermissionRetriever.EnqueueRetrievalAsync(TransformationContext trafoCtx, RetrievalMode mode, CancellationToken cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Console/ConfluenceMonitors/RetrieverBase.cs:line 138
   at WikiTraccs.Console.ConfluenceMonitors.RetrieverBase`2.<>c__DisplayClass41_0.QlVNDp4dhl6MEC2ANJN.MoveNext() in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Console/API/TheConfluenceCloudRestAPIClient.cs:line 23764
Inner Exception: System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
---> System.TimeoutException: A task was canceled.
---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at PnP.Framework.Http.RetryHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /_/src/lib/PnP.Framework/Http/RetryHandler.cs:line 106
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Microsoft.Identity.Client.Http.HttpManager.ExecuteAsync(Uri endpoint, IDictionary`2 headers, HttpContent body, HttpMethod method, ICoreLogger logger, CancellationToken cancellationToken)
   at Microsoft.Identity.Client.Http.HttpManager.ExecuteWithRetryAsync(Uri endpoint, IDictionary`2 headers, HttpContent body, HttpMethod method, ICoreLogger logger, Boolean doNotThrow, Boolean retry, CancellationToken cancellationToken)
    StatusCode: 0 
    ResponseBody:  
    Headers: 
[064 14:48:08 DBG  ] [https://CONFLUENCESERVER:8443] Checking that destination SharePoint site is prepared... | WikiTraccs.Shared.Stores.SPO.SpoWikiTraccsStore
[064 14:48:08 DBG  ] Entering CreatePnPContext... | WikiTraccs.Shared.Stores.SPO.PnPContextFactory

Anything else?

No response

heinrich-ulbricht commented 1 year ago

@PretoPlasma That's a new one. It looks like it cannot authenticate with Microsoft due to a timeout. Can you try with WikiTraccs.GUI?

How do the URLs look like that you enter here in the WikiTraccs site and Default target site fields?

WikiTraccs

Can you access both site URLs you entered there in a browser, on the same machine as WikiTraccs? Could something prevent a connection to the SharePoint tenant or any of the Microsoft authentication URLs (see the list of required endpoints here: Endpoint reference)? (VPN, Proxy, Firewall ...)

PretoPlasma commented 1 year ago

Thanks for your strong support. We could now establish running wikitraccs.

heinrich-ulbricht commented 1 year ago

@PretoPlasma I'm sorry to hear that. Drop me a message at contact@wikitransformationproject.com if you want to try it one last time, on a call. I'm also curious what's going on. If not, thanks for giving it a shot!

PretoPlasma commented 1 year ago

Sorry. @heinrich-ulbricht. It was a typo. I ment 'now' NOT 'not'. :-) Sorry for confusing you!!! Everything is running fine!

heinrich-ulbricht commented 1 year ago

Whoops. Ok that sounds better :D