Page 1 of 1
Error: SQL Query("UPDATE UserSessions set AuthToken : UNIQUE constraint failed: UserSessions.AuthToken
Posted: Sunday 07 April 2019 20:18
by zicht
Hi
Can anyone point me to the cause of an sql error that i see once or twice a day :
Error: SQL Query("UPDATE UserSessions set AuthToken = 'debed44de6a452bd8db46921d6c959f0', ExpirationDate = '2019-04-06 21:01:12', RemoteHost = '192.168.xxx.xxx', LastUpdate = datetime('now', 'localtime') WHERE SessionID = 'abe8a64dbf643742096b24bc51f1bd8'") : UNIQUE constraint failed: UserSessions.AuthToken
so i can try to solve it
Many thanks
Re: Error: SQL Query("UPDATE UserSessions set AuthToken : UNIQUE constraint failed: UserSessions.AuthToken
Posted: Monday 22 April 2019 0:59
by schumi2004
Same here.
Noticed it by accident and have no idea were it comes from or why it is happening.
In my situation it looks like there is a incomming connection from my router but have no idea why.
Re: Error: SQL Query("UPDATE UserSessions set AuthToken : UNIQUE constraint failed: UserSessions.AuthToken
Posted: Monday 22 April 2019 17:33
by waaren
zicht wrote: ↑Sunday 07 April 2019 20:18
Can anyone point me to the cause of an sql error that i see once or twice a day :
Error: SQL Query("UPDATE UserSessions set AuthToken = 'debed44de6a452bd8db46921d6c959f0', ExpirationDate = '2019-04-06 21:01:12', RemoteHost = '192.168.xxx.xxx', LastUpdate = datetime('now', 'localtime') WHERE SessionID = 'abe8a64dbf643742096b24bc51f1bd8'") : UNIQUE constraint failed: UserSessions.AuthToken
Opened
issue 3156 for this on github. Seems to be caused by a change back in february causing the AuthToken to be set to the encoded SessionId
Re: Error: SQL Query("UPDATE UserSessions set AuthToken : UNIQUE constraint failed: UserSessions.AuthToken
Posted: Wednesday 24 April 2019 14:12
by waaren
schumi2004 wrote: ↑Monday 22 April 2019 0:59
zicht wrote: ↑Sunday 07 April 2019 20:18Can anyone point me to the cause of an sql error that i see once or twice a day :
Error: SQL Query("UPDATE UserSessions set AuthToken = 'debed44de6a452bd8db46921d6c959f0', ExpirationDate = '2019-04-06 21:01:12', RemoteHost = '192.168.xxx.xxx', LastUpdate = datetime('now', 'localtime') WHERE SessionID = 'abe8a64dbf643742096b24bc51f1bd8'") : UNIQUE constraint failed: UserSessions.AuthToken
This was caused by the function that creates the SessionID token and the AuthToken when a new session (or API call) enters domoticz. If called in the same second it generated the same values. It's solved in V4.10620 where the same random seed is not generated again when called in the same second.
If not please revert.
Re: Error: SQL Query("UPDATE UserSessions set AuthToken : UNIQUE constraint failed: UserSessions.AuthToken
Posted: Wednesday 22 May 2019 7:13
by zicht
[/quote]
This was caused by the function that creates the SessionID token and the AuthToken when a new session (or API call) enters domoticz.
[/quote]
Found it was in my installation indeed an api call ... Thanks.
Re: Error: SQL Query("UPDATE UserSessions set AuthToken : UNIQUE constraint failed: UserSessions.AuthToken
Posted: Monday 05 June 2023 11:44
by MikeF
I am getting frequent error messages in Domoticz, such as the following:
2023-06-05 08:35:12.064 Error: SQL Query("UPDATE UserSessions set AuthToken = '1518e7f3279398e62ccff3f3e1babed0', ExpirationDate = '2023-06-05 08:45:12', RemoteHost = '192.168.0.55', LastUpdate = datetime('now', 'localtime') WHERE SessionID = 'f286a97cbe825ce9a2ce73e0f26056b9'") : UNIQUE constraint failed: UserSessions.AuthToken
I am running Domoticz 2022.2 on an RPi 4B under Buster. The RemoteHost (consistently) referred to in these messages is an Apple iMac, used to access the Domoticz webserver.
I understood that this had previously been fixed, in v4.10620:
waaren wrote: ↑Wednesday 24 April 2019 14:12
schumi2004 wrote: ↑Monday 22 April 2019 0:59
zicht wrote: ↑Sunday 07 April 2019 20:18Can anyone point me to the cause of an sql error that i see once or twice a day :
This was caused by the function that creates the SessionID token and the AuthToken when a new session (or API call) enters domoticz. If called in the same second it generated the same values. It's solved in V4.10620 where the same random seed is not generated again when called in the same second.
If not please revert.