Most teams treat OS patching as simple housekeeping. You apply the updates, reboot if needed, and move on. But on a PostgreSQL server, OS patching can also update database tools that were installed from the PostgreSQL package repository. When one of those tools has to talk to the same tool on another server, updating only one side can break things without any warning. That is exactly what happened to one of our customers recently. A normal patch night upgraded pgBackRest on the production database server but not on the backup server, and the next morning’s backup failed. The database never went down and no data was lost, but for several hours the newest backup they had was more than a day old. I am writing this because the cause was small, easy to miss, and very common. If you run pgBackRest with a separate backup server, the same trap may already be sitting in your setup. Key Takeaways
Routine OS patching can also update tools installed from the PostgreSQL package repository, such as pgBackRest, whenever dnf can see that repository. pgBackRest checks that the database server and the backup server run the exact same version before it does anything, and stops if they do not. Here, production was upgraded from 2.55.1 to 2.59.3 while the backup server stayed on 2.55.1, and the next morning’s backup failed within seconds. No data was lost, but for several hours the newest backup was more than a day old. The “unable to find primary cluster” error that follows is a side effect. Read the version error first, before you check replication. Prevent it with a version lock, a verification check after every patch cycle, and hiding the repository again as a standard step in the patching process.
One Small Step That Got Skipped Last month the PostgreSQL minor version was upgraded on the production system. To install the new packages, dnf had to see the PGDG repository, so the repository file was renamed back to its original name. The upgrade went smoothly. After the upgrade, though, the repo file was never renamed back to the temporary name. Nobody noticed, because nothing was wrong yet. On the backup server, the repository file was still renamed from an earlier patch cycle. We had not needed to install anything there, so it was never touched. So the two servers were now set up differently, and nobody knew it. Patch Night A few weeks later, the regular OS patching ran on both servers. On the production server, dnf could see the PGDG repository. It found a newer pgBackRest package and upgraded it from 2.55.1 to 2.59.3, along with the rest of the OS updates. On the backup server, the repository was still hidden, so pgBackRest stayed on 2.55.1. PostgreSQL itself was already on the latest minor version from last month’s upgrade, so dnf had nothing newer to install for it. If a newer minor release had been out, PostgreSQL would have been upgraded in the middle of an OS patch window, without testing, without a rollback plan, and without anyone watching.
Planning a bigger upgrade than a minor release? Semab Tariq, who wrote this post, presents our webinar Life After PostgreSQL 14. He shows how to move to PostgreSQL 18 with logical replication while production keeps running, how to rehearse the switchover, and how to keep a rollback path. 16 December 2026, 3:00 pm GMT. Register for the webinar →
The Next Morning The scheduled backup started on time from the backup server and failed within seconds. This is what the log showed: WARN: unable to check pg1: [ProtocolError] expected value '2.55.1' for greeting key 'version' but got '2.59.3' HINT: is the same version of pgBackRest installed on the local and remote host? ERROR: [056]: unable to find primary cluster - cannot proceed HINT: are all available clusters in recovery? The first line is the real problem. Before doing anything, pgBackRest checks that both hosts run the exact same version. The backup server expected 2.55.1, the database server answered with 2.59.3, and pgBackRest stopped right there. The second line looks much scarier, and it is easy to get sidetracked by it. It asks whether all clusters are in recovery, which makes you think the primary went down or got demoted to a standby. It had not. Since pgBackRest could not talk to the database server at all, it could not confirm which server was the primary, so it reported that it found none. PostgreSQL was healthy the whole time, and the application kept working normally. If you ever see these two errors together, read the first one carefully before you start checking your replication setup.
How We Fixed It
The customer spotted the failed backup and opened a Severity 1 ticket with the log attached. The two version numbers in the log told us most of the story, so our first question was whether any OS patching had happened recently. It had. We had two options. We could downgrade pgBackRest on the production server back to 2.55.1, or upgrade it on the backup server to 2.59.3. Upgrading the backup server was the cleaner choice, since it meant moving forward instead of rolling back a package on production. We kept the downgrade as a fallback in case the upgrade ran into trouble. pgBackRest on the backup server was upgraded to 2.59.3, and we started a backup by hand. It completed successfully the same day. Wrapping Up Nothing in this story was dramatic. No server crashed and no data was lost. A single file was left with its original name after an upgrade, and a few weeks later that was enough to stop backups on a production system. The fix took only a few minutes. Preventing it from happening again requires a version lock and a verification check after every patch cycle. Rather than relying on someone to remember to rename the repository, make this a standard step in the PostgreSQL and OS patching process. Ensure that the relevant repositories are renamed after each planned activity is completed. Frequently Asked Questions Why did a routine OS patch break pgBackRest backups? During OS patching, dnf could see the PGDG repository on the production server and upgraded pgBackRest from 2.55.1 to 2.59.3. On the backup server the repository was still hidden, so pgBackRest stayed on 2.55.1. pgBackRest checks that both hosts run the exact same version before doing anything, so the next backup stopped. What does the pgBackRest error “expected value for greeting key ‘version'” mean? It means the local and remote hosts run different versions of pgBackRest. Before doing anything, pgBackRest checks that both hosts run the exact same version, and it stops if they do not. Does “unable to find primary cluster” mean the primary is down? Not in this case. pgBackRest could not talk to the database server at all, so it could not confirm which server was the primary and reported that it found none. PostgreSQL was healthy the whole time. If you see both errors together, read the version error first before you start checking your replication setup. How do you fix a pgBackRest version mismatch? Bring both hosts to the same version. Here, pgBackRest on the backup server was upgraded to 2.59.3, which was cleaner than rolling back a package on production, with the downgrade kept as a fallback. A manual backup then completed the same day. Can OS patching upgrade PostgreSQL itself? Yes. If dnf can see the PGDG repository and a newer minor release is available, PostgreSQL can be upgraded in the middle of an OS patch window, without testing, without a rollback plan and without anyone watching. How do you stop OS patching from upgrading PostgreSQL tools? Use a version lock and a verification check after every patch cycle, and make hiding the repository again a standard step in the PostgreSQL and OS patching process, rather than relying on someone to remember it.
Would your team have caught this before the next backup? Our 24×7 PostgreSQL support gives you senior engineers on call, with a 15-minute response to Sev-1 incidents, on any platform. See 24×7 PostgreSQL support →
The post A Routine OS Patch Quietly Broke Our Production Backups appeared first on Stormatics.





![[$] Hardening system-call dispatch](/_next/image?url=https%3A%2F%2Fapi.wrkm.app%2Fstorage%2Fmedia%2Fdefaults%2Fcategory-operating-systems-v1.png&w=3840&q=75)
