A deeply buried bug in SQLite that went unnoticed for at least 16 years has been identified as the culprit behind months of outages at networking outfit Tailscale, demonstrating that even some of the industry’s most trusted software can still harbor nasty surprises. Tailscale revealed in a blog post that a rare race condition in SQLite’s write-ahead logging (WAL) mechanism caused 19 separate database corruption incidents over six months, beginning in August 2025. The problem repeatedly disrupted portions of its control plane, leaving some customers unable to establish new network connections or manage their existing networks.
The company has relied on SQLite as its primary database since 2022, using separate databases across its control plane shards. The arrangement had worked reliably for years before the mysterious corruption began appearing. According to Tailscale engineers, the company initially struggled to find any pattern behind the failures. The corruption affected different servers, appeared at unpredictable intervals, and could not be linked to particular customers, workloads or recent software changes. Engineers spent months investigating possible causes, including faulty file locking, memory management problems and threading issues. Eventually, Tailscale enlisted SQLite’s core developers to help investigate the problem.
The breakthrough came when Tailscale implemented a transaction logging system designed to reconstruct damaged databases. Engineers discovered that some transactions had successfully committed changes that subsequently disappeared without generating errors. Further investigation using a new SQLite virtual filesystem debugging tool, known as tmstmpvfs, exposed the underlying problem. The bug involved a race condition between a database write transaction and a write-ahead logging checkpoint operation. SQLite uses write-ahead logging to record changes before transferring them into the main database file, a process known as checkpointing. Under an extremely rare combination of circumstances, a write operation could interfere with a checkpoint, causing SQLite to believe that certain database pages had been copied successfully when they had not.
The result was permanently missing data and potentially corrupted databases. SQLite’s developers dubbed the problem the WAL-Reset bug, estimating that the faulty code had existed for at least 16 years. The bug had remained hidden largely because the conditions needed to trigger it were exceptionally uncommon. Tailscale, however, operates SQLite somewhat differently from most users. Rather than allowing SQLite to manage checkpointing automatically, the company manually controls the process to support its frequent database snapshots and backups.
This aggressive checkpointing schedule significantly increased the likelihood of encountering the race condition. Although the configuration was fully documented and supported, it pushed SQLite into operating conditions that apparently had received less real-world testing. The resulting outages were disruptive but relatively contained. Existing peer-to-peer WireGuard connections generally continued operating, while devices attempting to establish new connections could fail until the affected control plane shard recovered.
Tailscale also confirmed that its databases did not contain private encryption keys or network traffic. Some early recovery operations nevertheless resulted in lost configuration changes or device metadata. SQLite developers addressed the race condition with an additional check designed to detect when another thread had reset the write-ahead log during checkpointing. The fix initially appeared in SQLite 3.52.0, which Tailscale deployed gradually across its infrastructure. The automated integrity monitoring suddenly reported corruption in 13 databases. This time, the databases were not actually damaged. Instead, a change to floating-point conversion behavior in SQLite 3.52.0 caused inconsistencies in expression indexes containing high-precision timestamps.
The SQLite developers subsequently withdrew version 3.52.0 and released version 3.51.3 containing the WAL-Reset fix without the problematic optimization. A separate improvement to handle stale expression indexes arrived in SQLite 3.53.0. Tailscale also modified its timestamp handling to avoid the floating-point precision issue. To confirm that the original fix worked, Tailscale added instrumentation to detect when the conditions responsible for the race occurred. Two months later, its monitoring system finally caught the precise sequence that previously would have caused corruption. This time, the database remained intact.
By the time Tailscale published its findings in August 2026, the company reported another four months without database corruption incidents. The investigation also produced improvements to its backup and recovery infrastructure, along with a publicly available SQLite debugging tool that could help other developers investigate similar problems.
The episode is a reminder that mature, widely deployed software is not necessarily free of obscure defects. SQLite has earned its reputation for reliability over decades, but unusual workloads can still uncover problems that conventional testing and millions of deployments have missed. For Tailscale, finding the bug took six months, dozens of engineers and direct cooperation with SQLite’s maintainers. The upside is that the resulting fix benefits the wider SQLite ecosystem, not just one particularly unlucky networking company.







