isaacrlevin / presencelight

PresenceLight is a solution to broadcast your various statuses to light bulbs.
MIT License
419 stars 77 forks source link

Team Status continuous loading #776

Closed xxvladki closed 1 year ago

xxvladki commented 1 year ago

Error Occured Getting Batch Content from Graph Api - GraphWrapper:GetBatchContent Line: 106

Error occured interacting with lights - MainWindow.xaml:InteractWithLights Line: 604

Information | Getting Graph Data: Profle, Image, Presence - GraphWrapper:GetBatchContent Line: 86

Absoblogginlutely commented 1 year ago

I'm getting this on my machine now too. Looks similar to previous issues I've had. My password changed so wondering if that is it. I don't have any UI to get a new password prompt or log off/on again. Gui just shows a spinnning circle whilst it attempts to login. No login prompt shows up. Log file shows tons of entries like the following

{"Timestamp":"2023-01-11T08:00:00.1671298-05:00","Level":"Error","MessageTemplate":"Error Occured Getting Batch Content from Graph Api - GraphWrapper:GetBatchContent Line: 106","Exception":"Status Code: 0\r\nMicrosoft.Graph.ServiceException: Code: generalException\r\nMessage: An error occurred sending the request.\r\n\r\n ---> Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: Key not valid for use in specified state.\r\n at System.Security.Cryptography.ProtectedData.ProtectOrUnprotect(Byte[] inputData, Byte[] optionalEntropy, DataProtectionScope scope, Boolean protect)\r\n at PresenceLight.Graph.TokenCacheHelper.BeforeAccessNotification(TokenCacheNotificationArgs args) in D:\a\presencelight\presencelight\src\DesktopClient\PresenceLight\Services\Graph\TokenCacheHelper.cs:line 35\r\n at Microsoft.Identity.Client.TokenCache.Microsoft.Identity.Client.ITokenCacheInternal.OnBeforeAccessAsync(TokenCacheNotificationArgs args)\r\n at Microsoft.Identity.Client.Cache.CacheSessionManager.RefreshCacheForReadOperationsAsync()\r\n at Microsoft.Identity.Client.Cache.CacheSessionManager.RefreshCacheForReadOperationsAsync()\r\n at Microsoft.Identity.Client.Cache.CacheSessionManager.GetAccountsAsync()\r\n at Microsoft.Identity.Client.ClientApplicationBase.GetAccountsInternalAsync(ApiIds apiId, String homeAccountIdFilter, CancellationToken cancellationToken)\r\n at Microsoft.Identity.Client.ClientApplicationBase.GetAccountsAsync(CancellationToken cancellationToken)\r\n at Microsoft.Identity.Client.ClientApplicationBase.GetAccountsAsync()\r\n at PresenceLight.Graph.WPFAuthorizationProvider.AuthenticateRequestAsync(HttpRequestMessage request) in D:\a\presencelight\presencelight\src\DesktopClient\PresenceLight\Services\Graph\WPFAuthorizationProvider.cs:line 57\r\n at Microsoft.Graph.AuthenticationHandler.SendAsync(HttpRequestMessage httpRequestMessage, CancellationToken cancellationToken)\r\n at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)\r\n at Microsoft.Graph.HttpProvider.SendRequestAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)\r\n --- End of inner exception stack trace ---\r\n at Microsoft.Graph.HttpProvider.SendRequestAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)\r\n at Microsoft.Graph.HttpProvider.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)\r\n at Microsoft.Graph.BaseRequest.SendRequestAsync(Object serializableObject, CancellationToken cancellationToken,

Running "AppType": "Desktop", "AppVersion": "5.5.18"

Absoblogginlutely commented 1 year ago

Found by stopping presencelight, ensuring my active browser is on my office365 account profile and then deleting "C:\Users\username\AppData\Local\PresenceLight\msalcache.bin" and then restarting the app will push a login verification window to the browser and then everything is back to working again. Does that help you @xxvladki ?

isaacrlevin commented 1 year ago

Thanks @Absoblogginlutely, if your browser cookie gets mucked up, forcing the auth like above is a good idea