Agent windows get down sometimes

Hello,
From time to time, my agents are offline on the web interface even though the agent has been started.

In the logs of the agent manager, I have only one error before seeing them offline:

2022-06-28 03:14:52.699 ERROR pool-135-thread i.t.a.s.c                                Failed refreshing token due to authorization problem
org.apache.oltu.oauth2.common.exception.OAuthProblemException: invalid_grant, Session not active
	at org.apache.oltu.oauth2.common.exception.OAuthProblemException.error(OAuthProblemException.java:59)
	at org.apache.oltu.oauth2.client.validator.OAuthClientValidator.validateErrorResponse(OAuthClientValidator.java:63)
	at org.apache.oltu.oauth2.client.validator.OAuthClientValidator.validate(OAuthClientValidator.java:48)
	at org.apache.oltu.oauth2.client.response.OAuthClientResponse.validate(OAuthClientResponse.java:127)
	at org.apache.oltu.oauth2.client.response.OAuthClientResponse.init(OAuthClientResponse.java:96)
	at org.apache.oltu.oauth2.client.response.OAuthAccessTokenResponse.init(OAuthAccessTokenResponse.java:65)
	at org.apache.oltu.oauth2.client.response.OAuthClientResponse.init(OAuthClientResponse.java:101)
	at org.apache.oltu.oauth2.client.response.OAuthAccessTokenResponse.init(OAuthAccessTokenResponse.java:60)
	at org.apache.oltu.oauth2.client.response.OAuthClientResponse.init(OAuthClientResponse.java:120)
	at org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory.createCustomResponse(OAuthClientResponseFactory.java:82)
	at org.apache.oltu.oauth2.client.URLConnectionClient.execute(URLConnectionClient.java:111)
	at io.testproject.agent.security.d.accessToken(TestProjectAgent:31)
	at io.testproject.agent.security.c.h(TestProjectAgent:261)
	at io.testproject.agent.security.c.i(TestProjectAgent:283)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:830)
2022-06-28 03:14:52.701 WARN  pool-135-thread i.t.a.s.c                                Failed to refresh access token before it expired...
2022-06-28 03:14:52.703 INFO  auth-entry      i.t.a.f.c.a.a                            Trying to load Agent remote identity...
2022-06-28 03:14:52.706 INFO  auth-entry      i.t.a.f.c.a.a                            Agent is registered as [XXXXXXXXXX] (XXXXXXXXXX), proceeding to authentication...
2022-06-28 03:14:52.706 INFO  auth-entry      i.t.a.b.c.a                              Sent shutdown event to Signal server
2022-06-28 03:14:52.706 INFO  auth-entry      i.t.a.b.c.a                              Disconnecting Signal as part of the SignalClient stop sequence
2022-06-28 03:14:52.707 INFO  auth-entry      i.t.a.f.c.a.a                            Authenticating with TestProject...
2022-06-28 03:14:52.707 INFO  auth-entry      i.t.a.s.c                                Requesting authenticating token...
2022-06-28 03:14:52.708 INFO  EventThread     i.t.a.b.c.a                              Signal disconnected - io client disconnect
2022-06-28 03:14:52.708 WARN  state-machine   i.t.a.f.c.b                              Can't process 'SignalDisconnected' when in 'Authenticating' state
2022-06-28 03:14:52.847 INFO  auth-entry      i.t.a.s.c                                Authenticated successfully
2022-06-28 03:14:52.869 INFO  state-machine   i.t.a.f.c.a.h                            Starting Signal...
2022-06-28 03:14:53.151 INFO  EventThread     i.t.a.b.c.a                              Signal connected, awaiting authentication result...
2022-06-28 03:14:53.152 INFO  EventThread     i.t.a.b.c.a                              Sent empty Session ID
2022-06-28 03:14:54.197 INFO  EventThread     i.t.a.b.c.a                              Signal authentication finished
2022-06-28 03:14:54.197 INFO  EventThread     i.t.a.b.c.a                              Connection Session ID: XXXXXXXXXX
2022-06-28 03:14:54.198 INFO  EventThread     i.t.a.b.c.a                              Signal authorized

From what I understand there is an authentication problem but followed by a successful authentication request. But at this moment, the agent is seen offline on the web interface.

You just have to restart the agent to see it started on the web interface.

Can you please investigate the reconnection behavior of the agent?

Translated with DeepL Translate: The world's most accurate translator (free version)