Repository navigation
Description
Summary
On an ostree-backend host where /sysroot/ostree/bootc has never been created, bootc rollback swaps the deployment order (prints Next boot: rollback deployment) and then fails:
Next boot: rollback deployment
error: Rollback: Rollback (ostree): Updating storage root mtime: update_timestamps: No such file or directory (os error 2)
The rollback has taken effect on disk, but the command exits 1. Automation that checks the exit code concludes that the rollback failed. greenboot is one such caller: it logs Manual intervention required - rollback failed and does not reboot, so the host keeps running the image that failed its health checks.
This is the rollback counterpart of RHEL-153671 / #2118. #2118 fixed the same error for bootc upgrade --check by initializing the bootc storage first. rollback never reaches that initialization.
Environment
- Fedora CoreOS 45
- bootc 1.17.1-1.fc45
- rpm-ostree 2026.3-2.fc45
- greenboot 0.16.4 (greenboot-rs)
- ostree backend (not composefs)
The host was installed with coreos-installer, not bootc install. It is updated with rpm-ostree rebase ostree-image-signed:docker://quay.io/example/image:tag, not bootc upgrade/switch. On such a host, /sysroot/ostree contains only boot.0, boot.0.0, deploy and repo. There is no /sysroot/ostree/bootc.
Steps to reproduce
Tested on stock Fedora CoreOS 45.20261030.3.1 in a VM:
- Install Fedora CoreOS with
coreos-installer. rpm-ostree rebase ostree-unverified-registry:quay.io/fedora/fedora-coreos:stable, then reboot, so the deployment is container-image based.rpm-ostree kargs --append=repro=1, then reboot. Both deployments are now container-image based. Do not layer packages: with client-side layered packages,rollbackbails earlier withRollback is not container image based(deploy.rs L1350-L1352). Do not runbootc upgradeorbootc switch, which would create the directory (see below).- Confirm
/sysroot/ostree/bootcdoes not exist. - Run
sudo bootc rollback.
Our fleet hits the same failure when greenboot triggers the rollback after a red boot, because greenboot runs bootc rollback.
Actual
$ sudo bootc rollback
Next boot: rollback deployment
error: Rollback: Rollback (ostree): Updating storage root mtime: update_timestamps: No such file or directory (os error 2)
$ echo $?
1
The rollback has nonetheless taken effect:
bootc statusreportsrollbackQueued: true.- The boot loader entries are swapped: the entry without
repro=1is now the default. /run/reboot-requiredexists.
Expected
Either the rollback succeeds (exit 0), or it fails before changing the boot order. It should not commit the change and then report failure.
Cause
In deploy::rollback(), the call to update_mtime() comes after write_deployments() and write_reboot_required() (deploy.rs L1385-L1396 at v1.17.1; unchanged on main at L1468-L1479 and in v1.17.5):
booted_ostree
.sysroot
.write_deployments(&new_deployments, gio::Cancellable::NONE)?;
...
println!("Next boot: rollback deployment");
...
write_reboot_required(rollback_image.manifest_digest.as_ref())?;
sysroot.update_mtime()?;Storage::update_mtime() calls update_timestamps("ostree/bootc") and propagates any error (store/mod.rs L902-L919; main L1049-L1066). The cap-std-ext update_timestamps it uses is a plain utimensat(..., AT_SYMLINK_NOFOLLOW), so a missing path returns ENOENT. The doc comment says the touch exists so that bootc-status-updated.path (PathChanged=/ostree/bootc) fires.
On the ostree backend, ostree/bootc is created only as a side effect of Storage::get_ensure_imgstore() → CStorage::create(), which does create_dir_all("ostree/bootc") before initializing ostree/bootc/storage (podstorage.rs L311-L324). The other update_mtime() callers reach that first:
upgrade:image_exists_in_unified_storage()was hoisted above the--checkbranch in cli: Initialize bootc storage before upgrade --check #2118 for this reason (cli.rs L1411-L1414).switch:image_exists_in_unified_storage()(cli.rs L1637-L1641).- Any path through
deploy::stage():cleanup()→prune_container_store()→get_ensure_imgstore()(deploy.rs L1276, L957). This covers image-changingeditandinstall reset.
rollback touches neither, so it fails on any host that has never run one of the operations above. Hosts installed by coreos-installer and managed only by rpm-ostree are one example. The reports below show the same missing directory after Anaconda or bootc-image-builder ISO installs. bootc edit with a boot-order change calls deploy::rollback() directly (cli.rs L1810-L1811), so it should fail the same way.
The rollback call was added in 93079bb (#977, first released in v1.1.4). Image-store creation was already lazy then (bffb3bb), which makes the failure probably as old as the call. We inferred that from the code and have not run old releases.
Effect on greenboot
greenboot-rs runs bootc rollback and treats any non-zero exit as failure (handler.rs L171-L182). On failure it logs Manual intervention required - rollback failed and returns without calling handle_reboot (main.rs L404-L421). The result is a host that stays up on the failed deployment while the next boot already points at the previous one, until something else reboots it.
Effect on retries
Running bootc rollback a second time makes things worse. Status derives boot_order from deployment order: it is Rollback when the rollback deployment's index is below the booted one (status.rs L361-L370). The second run therefore undoes the first and fails the same way:
$ sudo bootc rollback
notice: Reverting queued rollback state
Next boot: current deployment
error: Rollback: Rollback (ostree): Updating storage root mtime: update_timestamps: No such file or directory (os error 2)
Afterwards rollbackQueued is false and the boot loader entries are back in their original order. A caller that retries on a non-zero exit alternates between the two states, and each attempt reports failure.
Related reports
- greenboot failed to rollback on bootc anaconda iso fedora-iot/greenboot-rs#112 shows the same error from
bootc rollbackunder greenboot on a fedora-bootc:43 host installed from a bootc-image-builder Anaconda ISO. It was closed after a commenter could not reproduce it on top of greenboot-rs#119, which changed OS detection. The bootc code path is unchanged at the SHAs cited above. - RHEL-153671 / cli: Initialize bootc storage before upgrade --check #2118 show the same error string from
bootc upgrade --check, which was fixed for upgrade only. - uupd update-check not working ublue-os/bazzite#2626 shows the same error string from
bootc upgrade --checkon rpm-ostree-managed hosts. - Support path-triggering when using composefs backend #2119 is related: the
/ostree/bootcmtime trigger and composefs.
Possible fixes (maintainers' call)
- Treat the mtime touch as best-effort: ignore
ENOENTinupdate_mtime(), or createostree/bootcthere. - Or ensure the directory exists in
rollbackbeforewrite_deployments(), as cli: Initialize bootc storage before upgrade --check #2118 did forupgrade --check, so that a failure happens before the boot order changes.
Workaround, tested: create the directory once, as root. /sysroot is read-only on FCOS, so remount it first:
$ sudo mount -o remount,rw /sysroot && sudo mkdir /sysroot/ostree/bootc
$ sudo bootc rollback
Next boot: rollback deployment
$ echo $?
0
Running bootc rollback again then reverts cleanly, also with exit 0. Running bootc upgrade or bootc switch once has the same effect as the mkdir, but also initializes ostree/bootc/storage.
Activity