Comments (31)
MS was having issues earlier today due to some snort detection rules - most noticable if you were behind a meraki firewall so it could have been that for you.
Your screen with the getbatchcontent errors looked very similar to what I was getting. The odd thing is that when it wasn't working for me I was never asked to login on the machine.
In the past I was able to keep the configuration by just copying the settings file back in as noted by shrekmachine earlier. Just for some reason it wouldn't work for me yesterday.
However, today my light has been lighting up all day successfully - very helpful - thanks!
from presencelight.
I've been getting the same issue too.
Did the usual uninstall, reinstall, copy appsettings.json back in. Did not fix the issue.
The logs do show the following
Error Occured getting Batch Content from Graph Api - GraphWrapper:GetBatchContent Line:106
Incidentally the chocolatey install also doesn't match the checksum.
appv 5.5.17
from presencelight.
I'm running standalone version and added the AAD settings per issue #585 and issue still occurs
from presencelight.
I'm seeing the same problem here in the docker version as well as the desktop version.
It works perfectly on the first run after installation/creation. After a restart it stops processing the Graph updates.
First run:
[08:00:07 INF] PresenceLight Running in Teams Mode - /src/PresenceLight.Web/Worker:InteractWithLights Line: 157 [08:00:09 INF] Presence is Available - /src/PresenceLight.Web/Worker:GetPresence Line: 227 [08:00:14 INF] PresenceLight Running in Teams Mode - /src/PresenceLight.Web/Worker:InteractWithLights Line: 157 [08:00:14 INF] Presence is Available - /src/PresenceLight.Web/Worker:GetPresence Line: 227 [08:00:19 INF] PresenceLight Running in Teams Mode - /src/PresenceLight.Web/Worker:InteractWithLights Line: 157 [08:00:19 INF] Presence is Available - /src/PresenceLight.Web/Worker:GetPresence Line: 227 [08:00:24 INF] PresenceLight Running in Teams Mode - /src/PresenceLight.Web/Worker:InteractWithLights Line: 157 [08:00:24 INF] Presence is Available - /src/PresenceLight.Web/Worker:GetPresence Line: 227 [08:00:29 INF] PresenceLight Running in Teams Mode - /src/PresenceLight.Web/Worker:InteractWithLights Line: 157 [08:00:29 INF] Presence is Available - /src/PresenceLight.Web/Worker:GetPresence Line: 227
Subsequent runs:
[05:10:42 WRN] Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. [05:10:42 INF] User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. [05:10:42 INF] User is Authenticated, starting worker - /src/PresenceLight.Web/Worker:ExecuteAsync Line: 47 [05:10:42 INF] Now listening on: https://[::]:443 [05:10:42 INF] Now listening on: http://[::]:80 [05:10:42 INF] Application started. Press Ctrl+C to shut down. [05:10:42 INF] Hosting environment: Production [05:10:42 INF] Content root path: /app/ [05:10:44 INF] User is daffster - /src/PresenceLight.Web/Worker:GetUserInformation Line: 186 [05:10:45 INF] Presence is Available - /src/PresenceLight.Web/Worker:GetPresence Line: 227
from presencelight.
same here
Any solution proposed?
from presencelight.
I just tried the latest version from the store and am able to login without issue.
Does the nightly work for any of you? You don't need to add your settings just valudate that you can login.
from presencelight.
I've got the same issue. I can only use the 'download' version and not the Window Store version as my company blocks everything..
This is the Json error I get:
{"Timestamp":"2022-07-15T20:06:28.6658971+02:00","Level":"Information","MessageTemplate":"Getting Graph Data: Profle, Image, Presence - GraphWrapper:GetBatchContent Line: 86","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":86,"FilePath":"D:\\a\\presencelight\\presencelight\\src\\PresenceLight.Core\\GraphServices\\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-15T20:06:38.5163859+02:00","Level":"Error","MessageTemplate":"Error Occured Getting Batch Content from Graph Api - GraphWrapper:GetBatchContent Line: 106","Exception":"Status Code: Forbidden\r\nMicrosoft.Graph.ServiceException: Code: Authorization_RequestDenied\r\nMessage: Insufficient privileges to complete the operation.\r\nInner error:\r\n\tAdditionalData:\r\n\tdate: 2022-07-15T18:06:38\r\n\trequest-id: 3569650f-c632-4fcc-abfe-fd87a0191669\r\n\tclient-request-id: 3569650f-c632-4fcc-abfe-fd87a0191669\r\n\r\n at Microsoft.Graph.BatchResponseContent.ValidateSuccessfulResponse(HttpResponseMessage httpResponseMessage)\r\n at Microsoft.Graph.BatchResponseContent.GetResponseByIdAsync[T](String requestId)\r\n at PresenceLight.Core.GraphWrapper.GetBatchContent(CancellationToken token) in D:\\a\\presencelight\\presencelight\\src\\PresenceLight.Core\\GraphServices\\GraphWrapper.cs:line 99","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":106,"FilePath":"D:\\a\\presencelight\\presencelight\\src\\PresenceLight.Core\\GraphServices\\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-15T20:06:40.5644146+02:00","Level":"Information","MessageTemplate":"Getting Graph Data: Profle, Image, Presence - GraphWrapper:GetBatchContent Line: 86","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":86,"FilePath":"D:\\a\\presencelight\\presencelight\\src\\PresenceLight.Core\\GraphServices\\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-15T20:06:40.6751155+02:00","Level":"Error","MessageTemplate":"Error Occured Getting Batch Content from Graph Api - GraphWrapper:GetBatchContent Line: 106","Exception":"Status Code: Forbidden\r\nMicrosoft.Graph.ServiceException: Code: Authorization_RequestDenied\r\nMessage: Insufficient privileges to complete the operation.\r\nInner error:\r\n\tAdditionalData:\r\n\tdate: 2022-07-15T18:06:40\r\n\trequest-id: 13ad8fcf-4e18-49cd-8c05-1ccbe4df7031\r\n\tclient-request-id: 13ad8fcf-4e18-49cd-8c05-1ccbe4df7031\r\n\r\n at Microsoft.Graph.BatchResponseContent.ValidateSuccessfulResponse(HttpResponseMessage httpResponseMessage)\r\n at Microsoft.Graph.BatchResponseContent.GetResponseByIdAsync[T](String requestId)\r\n at PresenceLight.Core.GraphWrapper.GetBatchContent(CancellationToken token) in D:\\a\\presencelight\\presencelight\\src\\PresenceLight.Core\\GraphServices\\GraphWrapper.cs:line 99","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":106,"FilePath":"D:\\a\\presencelight\\presencelight\\src\\PresenceLight.Core\\GraphServices\\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
It does not work on my Work laptop, it does work on my personal dekstop (both "Desktop v5.5.17" and nightly from Windows Store).
I've tried debugging, starting the PresenceLight
project, it does run the XAML app, but clicking on the "SIGN IN" button doesn't do anything.
This exception the pops up:
Microsoft.Identity.Client.MsalClientException
HResult=0x80131500
Message=No ClientId was specified.
Source=Microsoft.Identity.Client
StackTrace:
at Microsoft.Identity.Client.AbstractApplicationBuilder`1.Validate()
at Microsoft.Identity.Client.PublicClientApplicationBuilder.Validate()
at Microsoft.Identity.Client.PublicClientApplicationBuilder.Build()
at PresenceLight.Graph.GraphService.CreateAuthorizationProvider() in C:\Users\xx\source\personal\presencelight\src\DesktopClient\PresenceLight\Services\Graph\GraphService.cs:line 37
Ahh, looks like there is a lost settings.json
in the release, but it uses appsettings.json
. If I copy a working AADSettings
to it I get this exception:
Microsoft.Graph.ServiceException
HResult=0x80131500
Message=Code: Authorization_RequestDenied
Message: Insufficient privileges to complete the operation.
Inner error:
AdditionalData:
date: 2022-07-15T18:31:07
request-id: 66fc98bd-9598-4e60-96f5-d0811a61063a
client-request-id: 66fc98bd-9598-4e60-96f5-d0811a61063a
Source=Microsoft.Graph.Core
StackTrace:
at Microsoft.Graph.BatchResponseContent.<ValidateSuccessfulResponse>d__15.MoveNext()
at Microsoft.Graph.BatchResponseContent.<GetResponseByIdAsync>d__13`1.MoveNext()
at PresenceLight.Core.GraphWrapper.<GetBatchContent>d__13.MoveNext() in C:\Users\x\source\personal\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 99
This exception was originally thrown at this call stack:
[External Code]
PresenceLight.Core.GraphWrapper.GetBatchContent(System.Threading.CancellationToken) in GraphWrapper.cs
This is the corresponding code (failing on/at the last line):
IUserRequest userRequest = _graphServiceClient.Me.Request();
IPresenceRequest presenceRequest = _graphServiceClient.Me.Presence.Request();
BatchRequestContent batchRequestContent = new BatchRequestContent();
var userRequestId = batchRequestContent.AddBatchRequestStep(userRequest);
var presenceRequestId = batchRequestContent.AddBatchRequestStep(presenceRequest);
BatchResponseContent returnedResponse = await _graphServiceClient.Batch.Request().PostAsync(batchRequestContent, token).ConfigureAwait(true);
User user = await returnedResponse.GetResponseByIdAsync<User>(userRequestId).ConfigureAwait(true);
If I split these request:
IUserRequest userRequest1 = _graphServiceClient.Me.Request();
User user1 = await userRequest1.GetAsync(token).ConfigureAwait(true);
I get:
Microsoft.Graph.ServiceException
HResult=0x80131500
Message=Code: Authorization_RequestDenied
Message: Insufficient privileges to complete the operation.
Inner error:
AdditionalData:
date: 2022-07-15T18:38:23
request-id: 1e69272f-1da4-4e7b-822e-6ac220a92ea5
client-request-id: 1e69272f-1da4-4e7b-822e-6ac220a92ea5
ClientRequestId: 1e69272f-1da4-4e7b-822e-6ac220a92ea5
Source=Microsoft.Graph.Core
StackTrace:
at Microsoft.Graph.HttpProvider.<SendAsync>d__18.MoveNext()
at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__40.MoveNext()
at Microsoft.Graph.BaseRequest.<SendAsync>d__34`1.MoveNext()
at Microsoft.Graph.UserRequest.<GetAsync>d__5.MoveNext()
at PresenceLight.Core.GraphWrapper.<GetBatchContent>d__13.MoveNext() in C:\Users\x\source\personal\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 98
This exception was originally thrown at this call stack:
[External Code]
PresenceLight.Core.GraphWrapper.GetBatchContent(System.Threading.CancellationToken) in GraphWrapper.cs
And:
IPresenceRequest presenceRequest1 = _graphServiceClient.Me.Presence.Request();
Presence presence1 = await presenceRequest1.GetAsync(token).ConfigureAwait(true);
Gets:
Microsoft.Graph.ServiceException
HResult=0x80131500
Message=Code: Forbidden
Inner error:
AdditionalData:
request-id: 4f7085d7-2267-4971-b00b-943a38028f3d
date: 2022-07-15T18:39:28
client-request-id: 4f7085d7-2267-4971-b00b-943a38028f3d
ClientRequestId: 4f7085d7-2267-4971-b00b-943a38028f3d
Source=Microsoft.Graph.Core
StackTrace:
at Microsoft.Graph.HttpProvider.<SendAsync>d__18.MoveNext()
at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__40.MoveNext()
at Microsoft.Graph.BaseRequest.<SendAsync>d__34`1.MoveNext()
at Microsoft.Graph.PresenceRequest.<GetAsync>d__5.MoveNext()
at PresenceLight.Core.GraphWrapper.<GetBatchContent>d__13.MoveNext() in C:\Users\x\source\personal\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 101
This exception was originally thrown at this call stack:
[External Code]
PresenceLight.Core.GraphWrapper.GetBatchContent(System.Threading.CancellationToken) in GraphWrapper.cs
from presencelight.
awesome, thanks for supporting this with such details
from presencelight.
I also like to get detailed error reports 😂
If I can help with testing anything, let me know. I really don't understand why it works on my own desktop, and not on my work laptop. It's both on the exact same (work) account, on the same internet. I do have to mention I do not have Admin rights by default on my work laptop.
OK, to rule the possible admin rights out I also tested it while running Visual Studio with admin rights, same result.
Desktop: Windows 10 Pro 21H2 19044.1766
Laptop: Windows 10 Enterprise 21H2 19044.1766
from presencelight.
here it is not working, having full rights on WIN 11-. But I did not test the nightly yet. I use the MS Store version
from presencelight.
@KoalaBear84 thanks for this, it is really helpful. I wonder if your work PC has some group policies that are blocking things. Can you please look at Fiddler traces of both calls and let me know if there is anything different?
from presencelight.
I've tried, but don't succeed. I guess it now gives an error because of the an SSL error, because of Fiddler's not trusted certificate. Didn't find a way to disable it for GraphServiceClient
Microsoft.Graph.ServiceException
HResult=0x80131500
Message=Code: generalException
Message: An error occurred sending the request.
Source=Microsoft.Graph.Core
StackTrace:
at Microsoft.Graph.HttpProvider.<SendRequestAsync>d__19.MoveNext()
at Microsoft.Graph.HttpProvider.<SendAsync>d__18.MoveNext()
at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__40.MoveNext()
at Microsoft.Graph.BaseRequest.<SendAsync>d__34`1.MoveNext()
at Microsoft.Graph.UserRequest.<GetAsync>d__5.MoveNext()
at PresenceLight.Core.GraphWrapper.<GetBatchContent>d__13.MoveNext() in C:\Users\x\source\personal\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 92
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
HttpRequestException: The SSL connection could not be established, see inner exception.
Inner Exception 2:
IOException: Received an unexpected EOF or 0 bytes from the transport stream.
from presencelight.
Hmm. I've added an 'interceptor', forked, commited, restored the code on work laptop, got exceptions because the client id is empty, copied from desktop, and it worked..
Here is the fork, maybe come in handy.
https://github.com/KoalaBear84/presencelight
Maybe the code is not checking if the AADSettings.ClientId is empty? I don't know how the token thing works, so it's easy to check on your side. Clear the ClientId and run it?
from presencelight.
Not really following. Are you saying the deployed app the ClientId is blank?
from presencelight.
I got the 5.5.18 standalone tonight from chocolatey.
Running as admin or normal user on Windows 11.
I now get the following errors (a couple more than previously.
Note that I get the same issue with the Nightly build too
{"Timestamp":"2022-07-20T20:45:31.2138895-04: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, HttpCompletionOption completionOption)\r\n at Microsoft.Graph.Core.Requests.BatchRequest.PostAsync(BatchRequestContent batchRequestContent, CancellationToken cancellationToken)\r\n at PresenceLight.Core.GraphWrapper.GetBatchContent(CancellationToken token) in D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 109","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":106,"FilePath":"D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-20T20:45:33.2304832-04:00","Level":"Information","MessageTemplate":"Getting Graph Data: Profle, Image, Presence - GraphWrapper:GetBatchContent Line: 86","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":86,"FilePath":"D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-20T20:45:33.2791331-04: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, HttpCompletionOption completionOption)\r\n at Microsoft.Graph.Core.Requests.BatchRequest.PostAsync(BatchRequestContent batchRequestContent, CancellationToken cancellationToken)\r\n at PresenceLight.Core.GraphWrapper.GetBatchContent(CancellationToken token) in D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 109","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":106,"FilePath":"D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-20T20:45:37.2866858-04:00","Level":"Information","MessageTemplate":"Getting Graph Data: Profle, Image, Presence - GraphWrapper:GetBatchContent Line: 86","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":86,"FilePath":"D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-20T20:45:37.3288846-04: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, HttpCompletionOption completionOption)\r\n at Microsoft.Graph.Core.Requests.BatchRequest.PostAsync(BatchRequestContent batchRequestContent, CancellationToken cancellationToken)\r\n at PresenceLight.Core.GraphWrapper.GetBatchContent(CancellationToken token) in D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 109","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":106,"FilePath":"D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-20T20:45:37.3322005-04:00","Level":"Error","MessageTemplate":"Error occured interacting with lights - MainWindow.xaml:InteractWithLights Line: 604","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, HttpCompletionOption completionOption)\r\n at Microsoft.Graph.Core.Requests.BatchRequest.PostAsync(BatchRequestContent batchRequestContent, CancellationToken cancellationToken)\r\n at PresenceLight.Core.GraphWrapper.GetBatchContent(CancellationToken token) in D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 109\r\n at PresenceLight.Core.GraphWrapper.<>c__DisplayClass12_0.<b__0>d.MoveNext() in D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 80\r\n--- End of stack trace from previous location ---\r\n at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates
1 shouldRetryResultPredicates, Func5 onRetryAsync, Int32 permittedRetryCount, IEnumerable
1 sleepDurationsEnumerable, Func4 sleepDurationProvider, Boolean continueOnCapturedContext)\r\n at Polly.AsyncPolicy.ExecuteAsync[TResult](Func
3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)\r\n at PresenceLight.Core.GraphWrapper.GetProfileAndPresence(CancellationToken token) in D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 81\r\n at PresenceLight.Core.GraphServices.GetProfileAndPresenceHandler.Handle(GetProfileAndPresenceCommand command, CancellationToken cancellationToken) in D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GetProfileAndPresence\GetProfileAndPresenceHandler.cs:line 24\r\n at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)\r\n at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)\r\n at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)\r\n at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)\r\n at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)\r\n at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)\r\n at PresenceLight.MainWindow.InteractWithLights() in D:\a\presencelight\presencelight\src\DesktopClient\PresenceLight\MainWindow.xaml.cs:line 489","Properties":{"SourceContext":"PresenceLight.MainWindow","LineNumber":604,"FilePath":"D:\a\presencelight\presencelight\src\DesktopClient\PresenceLight\MainWindow.xaml.cs","MemberName":"InteractWithLights","Application":"PresenceLight"}}
{"Timestamp":"2022-07-20T20:45:37.3343682-04:00","Level":"Information","MessageTemplate":"Getting Graph Data: Profle, Image, Presence - GraphWrapper:GetBatchContent Line: 86","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":86,"FilePath":"D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
{"Timestamp":"2022-07-20T20:45:37.3757099-04: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, HttpCompletionOption completionOption)\r\n at Microsoft.Graph.Core.Requests.BatchRequest.PostAsync(BatchRequestContent batchRequestContent, CancellationToken cancellationToken)\r\n at PresenceLight.Core.GraphWrapper.GetBatchContent(CancellationToken token) in D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs:line 109","Properties":{"SourceContext":"PresenceLight.Core.GraphWrapper","LineNumber":106,"FilePath":"D:\a\presencelight\presencelight\src\PresenceLight.Core\GraphServices\GraphWrapper.cs","MemberName":"GetBatchContent","Application":"PresenceLight"}}
from presencelight.
Hrm... I would remove all instances of PresenceLight and restart and install the choco version again.
from presencelight.
Update, how I got the version from the WinStore (5.5.17) back to work:
- Save settings.json
- Uninstall PL via standard routine
- reinstall from WinStore
- Test run (worked fine, obviously w/o my config
- stopped PL
- copied settings.json (step 1) back to PL folder
- 2nd run, now with all settings incl. Philips Hue --> all fine
On a side note: the bug with the empty screen is still present, who have to resize the settings window to populate the controls
from presencelight.
Removed presencelight nightly, chocolatey version. Verified directory with settings was removed.
Reinstalled with Chocolatey. (version 5.5.18). Runtime version is 6.0.8
Opened application. Same issue occurs.
White screen with spinning logo.
Live logs show same issue as previously documented.
I didn't get prompted to sign in at all interestingly. I assume it's using SSO.
from presencelight.
@AHelsby I assume this is a work device. Are you able to try a personal one? I just tried on 3 different machines and was not able to repro
from presencelight.
Thanks @isaacrlevin - I was able to install on my work laptop (Windows 10) with no issues and was able to pull back my Teams status. On that laptop after install I was taken to the Office365Login page to obtain authentication and then able to get in.
On my work Windows11 desktop I was not taken to the Office365Login page after reinstalling.
Confirmed my appdata directory c:\users\username\appdata\roaming\presencelight is removed after the install.
Any registry entries I need to clear out before installing? I didn't find much with a search for Presencelight
I did delete a couple of entries from the windowsapp registry
AV in case it's of interest is Webroot with huntress and Opendns and Pi-Hole, web browsers have adblock plus installed. Both machines have all 3 protections included.
If theres any additional debugging I can do, then please let me know
Update: I deleted the app from enterprise applications in AD.
Launched the app - still no signin attempted.
Removed chocolatey install. Installed nightly build. Same issue occurred
Not sure why the app is not attempting/failing to sign in.
from presencelight.
So you aren't getting prompted to login on some machines? That is odd and I really can't help in that case.
from presencelight.
I do have this issue also. That's why I manually copied the token to the other computer. So it's a more common issue.
That was what I was trying to mention here
from presencelight.
Which/what is the token you copied @KoalaBear84?
I zipped up my chocolatey install from my working laptop and copied over to my chocolatey install on my nonworking desktop today. Opened app, same issue occurred.
On the nonworking desktop I went into appsettings.json and set clientid to "" and restarted the app
Now the application asks me to signin but clicking the signin button doesn't open a browser to authenticate.
The live logs is now blank and not showing anything.
Very odd.
from presencelight.
The app won't work if Client ID is blank. Frankly if it works on one machine but not another, I would look into what the differences are between those machines
from presencelight.
Yes, I think I copied the AADSettings.ClientId
over, but I see it was already included in the ZIP. So I'm not sure. Maybe I was confused by the lost "settings.json" which isn't used (If I'm correct).
It is empty here, but it might be filled in a build step or so.
https://github.com/isaacrlevin/presencelight/blob/main/src/DesktopClient/PresenceLight/appsettings.json
from presencelight.
Yes I add it in a build step. If it works on one machine and not another, it probably isn't a settings issue
from presencelight.
Stopped working on my laptop this week too :-(
I did a bit more digging last night and got it to work again (steps below that lose the original config)
First I closed the app.
choco uninstall Presencelight
Deleted c:\users%username%\appdata\local\PresenceLight
Deleted %appdata%\PresenceLight (C:\Users\username\AppData\Roaming\PresenceLight)
Reinstalled app.
Received login prompt.
Entered credentials. Received admin consent validation.
Accepted Admin Consent validation.
Restarted Presencelight.
Logged in.
I did have to go through and setup my Hue again - I tried copy/pasting from a saved settings file but that did not work for me.
Light is now synching correctly again.
from presencelight.
also, stopped working for me a few days ago, it eventually logs in but upon restart, just get loading circle on the availability screen, and here's the live logs
@Absoblogginlutely, is this the ultimate fix? Anyway I can keep settings because I have API links and rather not have to redo all those links!
EDIT: by the way, my computer is Windows 10 computer with no work restrictions (I'm the admin), and using the Windows Store App. All was working well (for months) up until 2 days ago
from presencelight.
Hi, just an update, here's 2 hours after starting other computer, it works again (without any intervention)
live logs:
and status page also good to go:
notice in the logs are a bit different, errors seem to be more benign (no line 106 error).
Is this a MS server issue, perhaps?
from presencelight.
this morning, I had no issues. Looks like a MS issue. thanks all!
from presencelight.
Closing
from presencelight.
Related Issues (20)
- Add option for presence sync based on Zoom HOT 1
- Ability to manually configure IP address HOT 3
- Yeelight stopped working HOT 1
- LFX not syncing post update HOT 16
- Using a Philips Wiz Connected Bulb HOT 2
- Set Color not working since today HOT 5
- Custom API - REST API Body Support HOT 5
- SmartLife / Tuya integracion HOT 1
- Command line option to set status and enable/disable sync? HOT 4
- Sync Teams Presence Error HOT 7
- LED is dim (using Wiz) HOT 1
- Problem with Serial communication HOT 8
- Unable to list lights for LIFX integration HOT 14
- Feature request: integrate Home Assistant // mqtt HOT 3
- Unhandled Error HOT 1
- Approval request not being received by Teams Admin HOT 1
- Error (again) using app with Hue Remote API HOT 2
- Wiz Connection Issue HOT 1
- WIZ Brightness Level
- Feature request: Notification of Teams unread chat.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presencelight.