Perte des credentials Ajax

Bonjour,

Régulièrement (environ toutes les 2 semaines) Jeedom perd la connexion a Ajax et je dois me reconnecter pour que cela remarche.

Voici c’erreur que j’ai quand la connexion est perdue:

Erreur lors de la requete à Ajax System : {"state":"nok","error":"Can no post Ajax server : User is not authorized"}

Informations Jeedom Delta

Core : 4.4.18 (master)
DNS Jeedom Delta : oui

Plugin : Ajax Systems
Version : 2024-09-08 01:20:30 (stable)

Bonjour,
Fais tu des modifications sur ton compte ajax ? Est ce bien un compte standard et non pro ? Je n’ai de mon soucis aucun probleme la dessus et je ne vois pas d’erreur sur notre service cloud donc ca semble etre une particularité de ton compte.

Bonjour Loic,
Non aucune modification, et c’est bien un compte standard.
La perte de credentials a deja eu lieu 2 fois depuis que j’ai installé le plugin il y a quelques mois, je n’arrive pas a le reproduire de maniere systematique
Et ensuite je me re-loggue et tout va bien

Bonjour

Pour info j’ai exactement le même souci un peu aléatoire

Erreur exécution de la commande [Alarmes][Alarme Ajax][Armement] : Erreur lors de la requete à Ajax System : {« state »:« nok »,« error »:« Can no post Ajax server : User is not authorized »}

Je me re-connecte et ça roule.

Manu

Bizarre j’ai pas le cas. Vous avez votre jeedom qui est hors ligne desfois pendant un certain temps ?

Pas à ma connaissance, mis à part quand elle bug à cause du pb de mémoire lié aux plugins Python. Mais ça ne coincide pas avec le souci sur Ajax.

Etrangement j’ai toujours acces aux infos, c’est juste la modification des etats qui est interdite

Voici les logs en mode debug

[2024-10-22 07:43:53][DEBUG] : [request] https://cloud.jeedom.com/service/ajaxSystem?path=%2Flogin => {"login":"*****@*****.com","passwordHash":"********","userRole":"USER","apikey":"*********************","url":"https:\/\/**********.eu.jeedom.link"}
[2024-10-22 07:43:54][DEBUG] : [login] {"sessionToken":"***********","userId":"***********","refreshToken":"*********************"}
[2024-10-22 08:43:23][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":0},"userId":"***********","hubId":"**********"}]}
[2024-10-22 08:43:56][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":1},"userId":"***********","hubId":"**********"}]}
[2024-10-22 10:40:50][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":0},"userId":"***********","hubId":"**********"}]}
[2024-10-22 10:41:04][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":1},"userId":"***********","hubId":"**********"}]}
[2024-10-22 23:42:34][DEBUG] : [request] https://cloud.jeedom.com/service/ajaxSystem?path=%2Frefresh => {"userId":"***********","refreshToken":"*********************"}
[2024-10-22 23:42:35][DEBUG] : [refreshToken] {"sessionToken":"*********************","userId":"***********","refreshToken":"*********************"}
[2024-10-22 23:42:35][DEBUG] : [request] https://cloud.jeedom.com/service/ajaxSystem?path=%2Fuser%2F***********%2Fhubs%2F**********%2Fcommands%2Farming&session_token=********************* => {"command":"NIGHT_MODE_ON","ignoreProblems":true}
[2024-10-22 23:42:36][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"HUB","id":"**********","updates":{"state":2},"userId":"***********","hubId":"**********"}]}
[2024-10-22 23:42:36][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"MOTION_CAM_OUTDOOR","id":"***********","updates":{"estimatedArmingState":0},"userId":"***********","hubId":"**********"}]}
[2024-10-22 23:42:36][DEBUG] : Received : {"apikey":"*********************","data":[{"recipient":{"id":"***********","type":"USER"},"event":{"eventId":"ACH5iQAAAZK2Loq1","hubId":"**********","hubName":"Centrale","eventType":"SECURITY","eventTypeV2":"SECURITY","eventCode":"M_22_02","sourceObjectType":"USER","sourceObjectId":"***********","sourceObjectName":"Raphael","sourceRoomId":null,"sourceRoomName":" ","timestamp":1729633356469,"additionalData":{"deviceMalfunctions":null,"relatedGroupsInfo":[{"id":"00000002","name":"Unknown"}],"actionSourceObjectId":null,"actionSourceObjectName":null,"actionSourceObjectType":null,"actionSourceObjectSubtype":null,"additionalDataType":"DEVICE_MALFUNCTIONS"},"additionalDataV2":null}}]}
[2024-10-22 23:52:38][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"temperature":23},"userId":"***********","hubId":"**********"}]}
[2024-10-23 07:00:07][DEBUG] : [request] https://cloud.jeedom.com/service/ajaxSystem?path=%2Frefresh => {"userId":"***********","refreshToken":"*********************"}
[2024-10-23 07:00:37][ERROR] : Erreur exécution de la commande [Local technique][Centrale Ajax][Desarmement] : Echec de la requête HTTP : https://cloud.jeedom.com/service/ajaxSystem?path=%2Frefresh cURL error : Operation timed out after 30000 milliseconds with 0 bytes received
[2024-10-23 07:39:31][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":0},"userId":"***********","hubId":"**********"}]}
[2024-10-23 07:39:31][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"HUB","id":"**********","updates":{"lastAlarmTimestamp":1729661971},"userId":"***********","hubId":"**********"}]}
[2024-10-23 07:39:31][DEBUG] : Received : {"apikey":"*********************","data":[{"recipient":{"id":"***********","type":"USER"},"event":{"eventId":"ACH5iQAAAZK34yxR","hubId":"**********","hubName":"Centrale","eventType":"ALARM","eventTypeV2":"ALARM","eventCode":"M_0F_20","sourceObjectType":"DOOR_PROTECT_PLUS","sourceObjectId":"**********","sourceObjectName":"Porte studio","sourceRoomId":"00000003","sourceRoomName":"Studio ","timestamp":1729661971537,"additionalData":null,"additionalDataV2":null}}]}
[2024-10-23 07:40:35][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":1},"userId":"***********","hubId":"**********"}]}
[2024-10-24 16:46:56][DEBUG] : [request] https://cloud.jeedom.com/service/ajaxSystem?path=%2Frefresh => {"userId":"***********","refreshToken":"*********************"}
[2024-10-24 17:33:42][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"temperature":24},"userId":"***********","hubId":"**********"}]}
[2024-10-24 17:41:30][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":0},"userId":"***********","hubId":"**********"}]}
[2024-10-24 17:41:35][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":1},"userId":"***********","hubId":"**********"}]}
[2024-10-24 17:41:38][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":0},"userId":"***********","hubId":"**********"}]}
[2024-10-24 17:41:43][DEBUG] : Received : {"apikey":"*********************","data":[{"type":"DOOR_PROTECT_PLUS","id":"**********","updates":{"reedClosed":1},"userId":"***********","hubId":"**********"}]}
[2024-10-25 01:47:09][DEBUG] : [request] https://cloud.jeedom.com/service/ajaxSystem?path=%2Frefresh => {"userId":"***********","refreshToken":"*********************"}
[2024-10-25 01:47:09][ERROR] : Erreur exécution de la commande [Local technique][Centrale Ajax][Mode nuit] : Erreur lors de la requete à Ajax System : {"state":"nok","error":"Can no post Ajax server : User is not authorized"}
[2024-10-25 01:47:11][DEBUG] : [request] https://cloud.jeedom.com/service/ajaxSystem?path=%2Frefresh => {"userId":"***********","refreshToken":"*********************"}
[2024-10-25 01:47:11][ERROR] : Erreur exécution de la commande [Local technique][Centrale Ajax][Mode nuit] : Erreur lors de la requete à Ajax System : {"state":"nok","error":"Can no post Ajax server : User is not authorized"}

On voit que la premiere erreur est un timeout lors d’un appel a un refresh token. Je soupconne que l’appel se fait malgre tout, donc le token est renouvelé côté Ajax, mais comme le plugin n’a pas eu de réponse a temps, il n’a pas recu l’update, et donc le token qu’il a devient obsolete

TL;DR Je pense que c’est une histoire de token tournant qui s’est mal rafraichi

Bonjour,
Merci pour le retour et la log la beta de demain du plugin devrait corriger le soucis.