DevOps & monitoring

Azure kernel upgrade breaks MongoDB startup due to rseq incompatibility

An automatic Azure VM kernel update to version 6.19+ caused MongoDB 8.x to refuse startup, requiring a manual GRUB rollback and package pinning to resolve.

Illustration of a Linux server struggling under the weight of a kernel update
Illustration created for this article

A routine morning turned into an urgent outage for a development team when their application stopped responding without any recent code deployments or configuration changes. The root cause was identified as an automatic Linux kernel upgrade performed by Azure during a maintenance window, which introduced an incompatibility with the running MongoDB instance.

What happened

The incident began when users reported connection failures, prompting the engineering team to investigate the status of their Azure virtual machine. Upon logging in, they found that the MongoDB service was in a failed state, exiting almost immediately after startup attempts with exit codes indicating a rapid failure within 35 to 48 milliseconds. Standard application logs provided no useful information, showing only a clean shutdown from days prior, which forced the team to dig deeper into system-level journals.

By filtering the system journal for fatal errors, the team discovered a specific error message stating that MongoDB cannot start on Linux kernel versions 6.19 and newer due to a known incompatibility. The Azure platform had silently upgraded the VM’s kernel to version 7.0.0-1014-azure, which is based on the problematic 6.19+ lineage. This triggered a hard safety block in MongoDB version 8.0.29, preventing the database from starting to avoid potential data corruption or instability related to the rseq system call.

Key details

  • Trigger: Azure automatically upgraded the Linux kernel on the VM during a scheduled maintenance window.
  • Incompatibility: MongoDB 8.x refuses to start on Linux kernel 6.19 and newer due to issues with the rseq system call.
  • Error identification: The issue was confirmed via journalctl logs, not standard MongoDB application logs.
  • Failed fixes: Changing file permissions, removing lock files, and upgrading MongoDB to version 8.0.32 did not resolve the issue.
  • Resolution: The team booted into an older, compatible kernel (6.17.0-1022-azure) by modifying GRUB configuration.
  • Prevention: Kernel packages were pinned using apt-mark hold to prevent future automatic upgrades until an official fix is available.

Background

Linux systems use a bootloader called GRUB (Grand Unified Bootloader) to select which kernel version to load when the server starts. Cloud providers like Azure often install new kernels during maintenance but keep older versions on disk. By default, GRUB selects the newest kernel, which can lead to unexpected behavior if the new kernel has compatibility issues with installed software. The rseq (restartable sequences) system call is a performance optimization in newer Linux kernels that some applications, including MongoDB, may not yet fully support or may conflict with in specific versions.

Package managers like apt use meta-packages such as linux-azure to point to the latest available kernel image. When these meta-packages are updated, the system installs the newest kernel and updates GRUB to boot it by default. Administrators can override this behavior by manually specifying a kernel version in the GRUB configuration or by "holding" specific packages to prevent them from being updated automatically.

Why it matters

This incident highlights the risks of relying on automatic infrastructure updates without adequate monitoring or change control processes. For teams running self-hosted software, a silent kernel upgrade can break critical services overnight, leading to significant downtime and troubleshooting effort. The lack of immediate visibility into infrastructure-level changes means that outages can appear mysterious, wasting valuable time on irrelevant debugging steps like checking permissions or application logs.

Furthermore, it underscores the importance of understanding the dependency chain between operating system components and application software. Even stable, long-term support versions of databases can have hard constraints on kernel versions. Without proactive management of kernel updates, organizations risk encountering similar blocks when cloud providers push new underlying OS versions. This is particularly relevant for small and mid-sized companies that may not have dedicated site reliability engineering teams to manage these low-level details.

What you can do

  • Monitor kernel versions: Regularly check installed and active kernel versions on your VMs using uname -r and dpkg --list | grep linux-image.
  • Pin critical packages: Use apt-mark hold on kernel meta-packages to prevent automatic upgrades that could introduce incompatibilities.
  • Configure GRUB timeouts: Set a non-zero GRUB_TIMEOUT in /etc/default/grub to allow manual kernel selection during boot if needed.
  • Verify compatibility: Before allowing kernel updates, check release notes for your core applications (like MongoDB) for known kernel incompatibilities.
  • Improve alerting: Implement monitoring that alerts on service startup failures and system journal errors, not just application-level health checks.
  • Document recovery steps: Keep a runbook for rolling back kernel versions via GRUB, including commands to update the bootloader and reboot safely.

More news

All news