Troubleshooting
Why a main-standby failover drops all Modbus channels
Short answer
When a Geo SCADA main-standby pair flips Main to Standby and back within a minute, every Modbus channel drops because only the Main server performs driver operations. The usual trigger is a missed heartbeat or a deadlock-detection trip caused by long database locks: read the DB lock percentage and longest lock time in Server Snapshots, treat a longest lock above a few seconds as the trigger, and cut server load until locks stay sub-second.
On this page
Every Modbus channel dropping at once, with the server state flipping from Main to Standby and back inside a minute, is not an Advanced Modbus driver fault — the driver is the victim. In a Geo SCADA Expert main-standby pair, only the Main server performs driver operations; when supervision demotes that server, every driver operation stops and every channel reports communication loss until a server is Main again. The flip itself is a supervision trip: a missed heartbeat, or deadlock detection concluding the database is stalled. The number that decides it is the longest database lock time in Server Snapshots — sub-second is the target, and a longest lock above a few seconds can trip the role change. Read that number before you touch anything on the driver.
What a role change does to the channels #
The partners in a Hot Standby pair watch each other with heartbeat polling, and that exchange establishes which server holds the Main role. Drivers such as Advanced Modbus run on the Main server only, and the Standby server performs no driver operations at all — it holds no live polling state to hand over. When supervision demotes the Main server, polling stops on every Modbus channel in the same instant and resumes only when a server is promoted back. A flip that completes in under a minute points at a transient stall, not a dead server.
Because every channel reports loss in the same instant, the alarm list floods with per-channel link-loss entries. This is exactly the pattern the how-to for creating a SCADA PLC communication alarm for link loss is built for: one server-level alarm that fires once per break, instead of hundreds of channel entries, keeps the real sequence readable in the event log. The event log will show no driver error anywhere, because the driver never faulted — the transition-then-loss sequence is itself the evidence.
What flips Main to Standby #
Two supervision paths can toggle the roles. The first is heartbeat failure: a Main server that misses the heartbeat exchange with its partner long enough gets demoted. The second is deadlock detection, when it is enabled in the Server Configuration for the server: if it concludes the database is deadlocked or stalled, the roles change. Both paths converge on the same cause in a post-upgrade case like this one — the database is locked too long for the server to look healthy.
Anything that holds a database lock for seconds can do it: heavy logic execution, large bursts of point updates, scheduled or scripted bulk changes, or added load from the upgraded version and its drivers. The Server Status Tool's Locks category lists every lock the server holds, and the lock diagnostics record each lock's start time, so you can see both how long locks ran and when each one began relative to the flip. The Geo SCADA server administration documentation also covers ICMP alongside heartbeat polling for watching the partners, and both checks depend on the path between the servers staying healthy.
Fixes that fail first #
Four responses fail, and each fails for a structural reason:
- Restarting the driver or the channels. The driver did not fail, so a restart only clears the symptom until the next demotion.
- Hunting the event log for a driver error. There is none to find: the server demoted itself, and the driver was never the problem.
- Rolling back the driver alone. The upgrade changed the load on the whole server, so a rollback that leaves the longest lock time above a few seconds leaves the failovers in place.
- Raising Modbus timeouts. That postpones the moment a channel declares loss and does nothing about the role change that causes the loss.
When every read stops while the field devices stay healthy, the fault usually sits one layer up from the wire — the CODESYS OPC DA memory growth case that stops SCADA reads ends the same way, on the server rather than the channel.
Reading the lock times for a flip that lasts 45 seconds #
The values below are example readings in the pattern this fault produces; read your own from Server Snapshots before acting on the decision.
Inputs:
- Flip window: Main to Standby at 08:14:02, back to Main at 08:14:47 — 45 s in Standby (example timestamps showing the under-a-minute pattern).
- DB lock percentage across that minute: 78% (example Server Snapshots reading).
- Longest single lock in that minute: 5 s (example reading); the remaining locks sit at 0.6 s or shorter.
- Working line: a longest lock of 3 s — the working reading of "a few seconds", the point past which supervision can demote the Main server. The target is 1 s or less.
Rule in words: multiply the DB lock percentage by the window length to get the total time the database spent locked around the flip, then set the single longest lock against the working line.
Arithmetic:
- Standby time: 08:14:47 - 08:14:02 = 45 s.
- Locked time in the 60 s window: 0.78 × 60 s = 46.8 s.
- Distance past the line: 5 s - 3 s = 2 s, and that one lock alone covers 5 ÷ 60 = 8.3% of the window.
Result: the database was locked for roughly 47 of the 60 seconds around the flip, and a single lock held well past the working line. Those readings match a deadlock or heartbeat trip; they do not match a driver fault.
Decision: with the longest lock above the line, treat the supervision trip as the trigger, move to the load hunt below, and keep cutting load until the longest lock reads under 1 s. If yours already sits below that line and the pair still flips, stop tuning load and escalate with the log files — the trigger is elsewhere.
Isolating the trigger #
- Timestamp the role transitions in the event log and the moment of the first channel loss, and confirm the transition comes first. If channels drop with no state change, the mechanism in this article is not your case — look at the wire and the driver instead.
- Open Server Snapshots on the Main server around those times and read the DB lock percentage and the longest lock times. One snapshot can miss a brief spike, so capture several windows near the event rather than one.
- If the longest lock is past the working line, find the load source: heavy logic execution, scripted or scheduled bulk tasks, bursts of point updates, and anything that arrived with the upgrade. Reschedule or split that load until the longest lock time is back under the target.
- For a test window, disable deadlock detection in the Server Configuration for the server. Tell the control room before you do this on a live pair — if detection was catching a real stall, the stall comes back with detection off. If the failovers stop, detection was the trigger, and the lock time behind it still needs fixing.
- Read the change log of the version you moved to against the one you left, looking for anything that raises server load, including changes to the Advanced Modbus driver.
- If the locks already sit below the target, or the failovers continue after the load fix, collect the DBServer log files and the Advanced Modbus driver log files and open a support case. Support reads role changes in those logs even when the event log shows nothing.
Verifying the fix #
Run the pair through at least the period in which the failovers used to occur — if they clustered around a scheduled task, run through that task with it active. Pass means three things at once: no Main-to-Standby transition in the event log, every Advanced Modbus channel online throughout, and the longest lock time back under the target in Server Snapshots. If you disabled deadlock detection for the test, treat that result as diagnostic only: fix the load, re-enable detection, and confirm a full clean run with it live before you close the case.
Pitfalls on a main-standby pair #
- Disabling deadlock detection hides a stall; it does not fix one. Keep reading the snapshot lock times for as long as it stays off.
- Check the Standby server as well. A server that takes over while itself under heavy load can lock up the same way and hand the roles straight back.
- After the upgrade, confirm both servers of the pair actually run the same version. A half-upgraded pair adds a second explanation for odd role behavior, and this diagnosis does not need two variables.
- Keep the Modbus timeouts where they were once the role stays put. Raising them to soften the next break also delays an honest one.
If the locks are clean and the pair still flips, the answer is in the DBServer log rather than in any setting covered here — send the logs up.
Questions asked
Does a planned failover drop the Modbus channels too?
Yes. Every role change stops polling, because only the Main server performs driver operations and the Standby server performs none, so all Advanced Modbus channels report communication loss for the whole switch. Plan around it: warn the control room, move the switch to a quiet period, and expect one link-loss entry per channel per changeover in the event log. A clean planned switch is normal operation, not the fault pattern described here.
How do the servers decide which one is Main?
The partners watch each other with heartbeat polling, and the Geo SCADA server administration documentation also covers ICMP for watching a standby partner; the heartbeat exchange is what establishes which server holds the Main role. If the Main server misses that exchange, or deadlock detection concludes the database is stalled, the roles change. A fault on the network between the partners can trip either check, so keep that path on your list of suspects.
What should I collect before opening a support case?
Send the DBServer log files and the Advanced Modbus driver log files covering the flip window, together with the exact transition timestamps and the Server Snapshots readings for DB lock percentage and longest lock time. Note the version you upgraded from and to, whether deadlock detection is enabled, and how the two servers are connected. Those logs let support read the role changes even when the event log shows no driver fault.
Can deadlock detection stay disabled permanently?
Treat disabled as a diagnostic only. Deadlock detection exists to catch a genuinely stalled database, and with long locks still present the stall returns with nothing watching for it. Fix the load that lengthens the locks, confirm the longest lock time back under the one-second target in Server Snapshots, then re-enable detection and require a full clean day with no role change in the event log before you call the pair healthy.