Git Product home page Git Product logo

Comments (31)

Absoblogginlutely avatar Absoblogginlutely commented on September 26, 2024 1

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.

Absoblogginlutely avatar Absoblogginlutely commented on September 26, 2024

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
image
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.

Absoblogginlutely avatar Absoblogginlutely commented on September 26, 2024

I'm running standalone version and added the AAD settings per issue #585 and issue still occurs

from presencelight.

daffster avatar daffster commented on September 26, 2024

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.

Shrekmachine avatar Shrekmachine commented on September 26, 2024

same here
Any solution proposed?

from presencelight.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

I just tried the latest version from the store and am able to login without issue.

image

Does the nightly work for any of you? You don't need to add your settings just valudate that you can login.

from presencelight.

KoalaBear84 avatar KoalaBear84 commented on September 26, 2024

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.

Shrekmachine avatar Shrekmachine commented on September 26, 2024

awesome, thanks for supporting this with such details

from presencelight.

KoalaBear84 avatar KoalaBear84 commented on September 26, 2024

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.

Shrekmachine avatar Shrekmachine commented on September 26, 2024

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.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

@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.

KoalaBear84 avatar KoalaBear84 commented on September 26, 2024

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.

KoalaBear84 avatar KoalaBear84 commented on September 26, 2024

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.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

Not really following. Are you saying the deployed app the ClientId is blank?

from presencelight.

Absoblogginlutely avatar Absoblogginlutely commented on September 26, 2024

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, ResultPredicates1 shouldRetryResultPredicates, Func5 onRetryAsync, Int32 permittedRetryCount, IEnumerable1 sleepDurationsEnumerable, Func4 sleepDurationProvider, Boolean continueOnCapturedContext)\r\n at Polly.AsyncPolicy.ExecuteAsync[TResult](Func3 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, RequestHandlerDelegate1 next)\r\n at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next)\r\n at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next)\r\n at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next)\r\n at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next)\r\n at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 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.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

Hrm... I would remove all instances of PresenceLight and restart and install the choco version again.

from presencelight.

Shrekmachine avatar Shrekmachine commented on September 26, 2024

Update, how I got the version from the WinStore (5.5.17) back to work:

  1. Save settings.json
  2. Uninstall PL via standard routine
  3. reinstall from WinStore
  4. Test run (worked fine, obviously w/o my config
  5. stopped PL
  6. copied settings.json (step 1) back to PL folder
  7. 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.

AHelsby avatar AHelsby commented on September 26, 2024

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.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

@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.

AHelsby avatar AHelsby commented on September 26, 2024

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.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

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.

KoalaBear84 avatar KoalaBear84 commented on September 26, 2024

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.

Absoblogginlutely avatar Absoblogginlutely commented on September 26, 2024

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.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

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.

KoalaBear84 avatar KoalaBear84 commented on September 26, 2024

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.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

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.

Absoblogginlutely avatar Absoblogginlutely commented on September 26, 2024

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.

Anto79-ops avatar Anto79-ops commented on September 26, 2024

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

image

@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.

Anto79-ops avatar Anto79-ops commented on September 26, 2024

Hi, just an update, here's 2 hours after starting other computer, it works again (without any intervention)

live logs:

image

and status page also good to go:

image

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.

Anto79-ops avatar Anto79-ops commented on September 26, 2024

this morning, I had no issues. Looks like a MS issue. thanks all!

from presencelight.

isaacrlevin avatar isaacrlevin commented on September 26, 2024

Closing

from presencelight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.