VICIdial: "There is a time synchronization problem with your system"
As VICIdial prints it
There is a time synchronization problem with your system, please tell your system administrator
Where it appears. On the agent screen after login, as a box over the whole page with a Go Back link under the message.
To the point
Three clocks are compared for the agent screen: the dialer's last check-in, the database's time and the web server's. This box means two of them are more than 8 seconds apart, or that the dialer has stopped checking in.
What it means
Every dialer has one row in a table named server_updater. The row holds last_update, the time the dialer last checked in, and db_time, a timestamp the database sets by itself each time the row is written.
Once a second the agent screen asks the web server for its status. The web server reads that row for the agent's dialer and works out two differences: the dialer's check-in time less the database's time, and the database's time less the web server's own clock. When either one is more than 8 seconds, in either direction, the answer says TIME_SYNC. The test is made when the clock's seconds end in 0, so the box can come back every ten seconds.
The box is shown only while the system setting Agent Disable Display is ALL, which is its default. Go Back closes it. It does not log the agent out.
Causes
- The dialer has stopped checking in. Its row is no longer written, so the database's timestamp on it stays in the past while the web server's clock moves on. Eight seconds later the second difference is too large. No clock is wrong in this case.
- Clocks that drifted apart. On a cluster the dialer, the database server and the web server each keep their own clock. A gap of more than 8 seconds between two that the test compares sets it off.
Checks
- Reports. The server table is at the foot of the page. Click the + beside SERVER: a TIME column shows each server's last check-in, and two more rows show PHP Time and DB Time. A server's row turns red once the web server's clock is more than 10 seconds past that check-in.
- On the dialer, run
screen -ls. The keepalive script runs the dialer's processes in sessions named ASTupdate, ASTsend, ASTlisten and ASTVDauto. - On every server, read the clock with
dateand see that a time service is running. Trustane's own health check looks for chronyd, ntpd or systemd-timesyncd. - Admin > System Settings > Agent Disable Display. ALL shows this box to agents. Any other value hides it and leaves the clocks as they are.
Fix
- No check-in: find out why the dialer's processes stopped. The keepalive script starts each one it finds missing whenever it runs, so a session that stays absent points at the script or its schedule.
- Drift: run a time service on every server, all set to the same source.
On a Trustane server
The console's Health page reads the same check-in row. It turns amber when the last check-in is a minute old and red at five minutes, and it says when the clock is not being kept in step.
Related messages
- LAGGED: agents paused by a 30 second rule that rests on the same clocks.
- Your session has been disabled: the other box the same status answer can raise.
- Dial timed out, contact your system administrator: a call that the dialer's processes never placed.
Sources
Every statement above about VICIdial was read from its own source code at the revision given. An installed server can run another revision: compare before you rely on a line number.
- VICIdial svn r4037, www/agc/vicidial.php, lines 25205-25208: this message and its Go Back link
- VICIdial svn r4037, www/agc/vicidial.php, lines 8485-8490: the box opened on TIME_SYNC while Agent Disable Display is ALL
- VICIdial svn r4037, www/agc/vicidial.php, line 6363: the one second between two checks
- VICIdial svn r4037, www/agc/conf_exten_check.php, lines 1227-1236: the three times read and the two differences
- VICIdial svn r4037, www/agc/conf_exten_check.php, lines 1384-1385: the 8 second limit, tested when the seconds end in 0
- VICIdial svn r4037, extras/MySQL_AST_CREATE_tables.sql, lines 257-262: the server_updater table: a date and time, and a timestamp the database sets
- VICIdial svn r4031, www/vicidial/admin.php, lines 52761-52912: the server table of the Reports page: TIME, PHP Time, DB Time and the red row
- VICIdial svn r4031, www/vicidial/admin.php, lines 47063-47069: Agent Disable Display in System Settings
- VICIdial svn r4038, www/vicidial/help_documentation.txt, line 1133: the help for Agent Disable Display and its default
- VICIdial svn r4031, bin/ADMIN_keepalive_ALL.pl, lines 926-934: the keepalive script deciding that a process is missing
- VICIdial svn r4031, bin/ADMIN_keepalive_ALL.pl, lines 1058-1107: the screen sessions it starts: ASTupdate, ASTsend, ASTlisten, ASTVDauto
- Trustane console: the Health page: the age of the last check-in and whether the clock is kept in step
- Trustane console: the time services the health check looks for