WikiTransformationProject / wikitraccs-releases

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

[Bug] Unhandled exception in subscription of AttachToRequestPipeline->scanRequestObservable #78

Closed PretoPlasma closed 11 months ago

PretoPlasma commented 11 months ago

Is there an existing issue for this?

Current Behavior

After passing the final connectivity tests of the GUI.app and starting the transformation by using the CONSOLE.app the process stucks in the moment whilst: "Checking that destination SharePoint site is prepared" throwing after a while ERR: Unhandled exception in subscription of AttachToRequestPipeline->scanRequestObservable

Expected Behavior

The destination check should pass successfully and the transformation should reach the start migrate point.

WikiTraccs Version

v1.6.29

Confluence Version

Confluence 7 (up to 7.17)

Confluence Data Center?

Relevant log output or page storage format

[030 18:16:57 DBG  ] [https://confluenceserver] Checking that destination SharePoint site is prepared: https://sharepoint/site ... | WikiTraccs.Shared.Stores.SPO.StorePreparator
[010 18:16:57 ERR  ] [https://confluenceserver] Unhandled exception in subscription of AttachToRequestPipeline->scanRequestObservable | WikiTraccs.Console.ConfluenceMonitors.ConfluenceContentRetriever
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 482
   at WikiTraccs.Shared.Stores.SPO.PnPPowerShellExtract.ConnectOnline.OLvTiPl16R(NetworkCredential  , InitializationType  ) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/PnPPowerShellExtract/PnPCredentialManager.cs:line 383
   at WikiTraccs.Shared.Stores.SPO.PnPPowerShellExtract.ConnectOnline.Connect(CancellationToken& cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/PnPPowerShellExtract/PnPCredentialManager.cs:line 276
   at WikiTraccs.Shared.Stores.SPO.PnPPowerShellExtract.ConnectOnline.ProcessRecord() in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/PnPPowerShellExtract/PnPCredentialManager.cs:line 143
   at WikiTraccs.Shared.Stores.SPO.PnPContextFactory.CreatePnPContext(TransformationContext trafoCtx) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/SpaceInventoryItem.cs:line 6
   at WikiTraccs.Shared.Stores.SPO.SpoStoreBase.EnsureInitAsync(TransformationContext trafoCtx, Boolean forceNew)
   at WikiTraccs.Shared.Stores.SPO.SpoWikiTraccsStore.i7Ff8UjvG9(TransformationContext  , CancellationToken  ) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/StorePreparator.cs:line 70
   at WikiTraccs.Shared.Stores.SPO.SpoWikiTraccsStore.GetPreparationStateAsync(TransformationContext trafoCtx, CancellationToken cancellationToken)
   at WikiTraccs.Shared.Stores.SPO.StorePreparator.EnsureSitePreparationAsync(IPreparableTarget target, TransformationContext trafoCtx, Func`1 shallPrepareCallback, Boolean throwOnFailure, CancellationToken cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Shared/Stores/SPO/TransformedPageInfo.cs:line 25
   at WikiTraccs.Shared.Stores.SPO.SpoStoreBase.EnsureSiteIsPrepared(TransformationContext trafoCtx, CancellationToken cancellationToken)
   at WikiTraccs.Shared.Stores.SPO.SpoWikiTraccsStore.GetSpaceInventoryForTenantAsync(TransformationContext trafoCtx, Boolean onlyWithTrafoRequest, CancellationToken cancellationToken)
   at WikiTraccs.Shared.Registries.WikiTraccsRegistry.GetSpaceInventoryForTenantAsync(TransformationContext trafoCtx, Boolean onlyWithTrafoRequest, Boolean ignoreCache, CancellationToken cancellationToken)
   at WikiTraccs.Console.ConfluenceMonitors.ConfluenceContentRetriever.EnqueueRetrievalAsync(TransformationContext trafoCtx, RetrievalMode modeOBSOLETEDONOTUSE, CancellationToken cancellationToken) in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Console/ConfluenceMonitors/ConfluencePermissionsRetriever.cs:line 667
   at WikiTraccs.Console.ConfluenceMonitors.RetrieverBase`2.<>c__DisplayClass47_0.zUgy0I3tMy8woKEUMa0.MoveNext() in /home/runner/work/wikitraccs-code/wikitraccs-code/WikiTraccs.Console/API/TheConfluenceCloudRestAPIClient.cs:line 23884Inner 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:
[030 18:16:57 DBG  ] Entering CreatePnPContext... | WikiTraccs.Shared.Stores.SPO.PnPContextFactory

Anything else?

I assume that there is a problem with the connecting of the user to the site. Can you agree and if this is true could you let me know which right should be set? If I am wrong could you pls kindly advise what to do?

PretoPlasma commented 11 months ago

In addition I can report that trying to "Updating space inventory and WikiTraccs site..." through GUI.app throws the acception "Failure. Cannot build space inventory. The SharePoint connection test failed. Hope this helps.

heinrich-ulbricht commented 11 months ago

This sounds like #68 again. How did you solve this the last time?

Are you by any chance running WikiTraccs in AWS and could by any chance the note about AWS here apply?

Is the error consistently happening, 100% of the time? Or does it sometimes continue and sometimes not? I'm thinking about intermittent connectivity issues that might be at play here.

If it is specifically and consistently stuck at the authentication step I'd like to test authenticating using PnP PowerShell, outside WikiTraccs. PnP PowerShell uses the same endpoints as WikiTraccs and any blocked endpoints should surface there as well.

The test with PnP PowerShell would go like this:

The last command should output a long string like eyJ0eXAiOiJKV1QiLCJub25jZSI6.....manycharacters.

Does this work? If not, there's an issue in your environment. If yes: we need to dig further.

PretoPlasma commented 11 months ago

Thanks for your strong support! You are right, #68 is same. Sorry for confusion. This time we could not fix it, we changed the machine running the console. On the other machine it is now fine. And due to your reminder we do know now what might cause the issue (network). You can close this one!