From 3d917a395cf6b9654955c38dfc5797d443613773 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 11 Feb 2025 12:17:11 +0100 Subject: [PATCH 1/6] docs: add v5.4 to API reference Signed-off-by: Paul Holzinger --- docs/source/Reference.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/Reference.rst b/docs/source/Reference.rst index 61dcc64dc1..3f84612907 100644 --- a/docs/source/Reference.rst +++ b/docs/source/Reference.rst @@ -7,6 +7,8 @@ Show the API documentation for version: * `latest (main branch) <_static/api.html>`_ +* `version 5.4 <_static/api.html?version=v5.4>`_ + * `version 5.3 <_static/api.html?version=v5.3>`_ * `version 5.2 <_static/api.html?version=v5.2>`_ From 2612e3c2334f8be84bab18828371a9cb4ce07d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Rod=C3=A1k?= Date: Tue, 11 Feb 2025 11:15:02 +0100 Subject: [PATCH 2/6] Bump FreeBSD version to 13.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Version 13.3 is EOL. See https://www.freebsd.org/releases/ Signed-off-by: Jan Rodák --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5c7545ea8e..5bd128b978 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -322,7 +322,7 @@ freebsd_alt_build_task: TEST_FLAVOR: "altbuild" ALT_NAME: 'FreeBSD Cross' freebsd_instance: - image_family: freebsd-13-3 + image_family: freebsd-13-4 setup_script: - pkg install -y gpgme bash go-md2man gmake gsed gnugrep go pkgconf zstd build_amd64_script: From 3d344ffd2673586f70abb8aee362cdbb2af1aa11 Mon Sep 17 00:00:00 2001 From: Matt Heon Date: Thu, 5 Dec 2024 08:35:36 -0500 Subject: [PATCH 3/6] In SQLite state, use defaults for empty-string checks As part of our database init, we perform a check of the current values for a few fields (graph driver, graph root, static dir, and a few more) to validate that Libpod is being started with a sane & sensible config, and the user's containers can actually be expected to work. Basically, we take the current runtime config and compare against values cached in the database from the first time Podman was run. We've had some issues with this logic before this year around symlink resolution, but this is a new edge case. Somehow, the database is being loaded with the empty string for some fields (at least graph driver) which is causing comparisons to fail because we will never compare against "" for those fields - we insert the default value instead, assuming we have one. Having a value of "" in the database largely invalidates the check so arguably we could just drop it, but what BoltDB did - and what SQLite does after this patch - is to use the default value for comparison instead of "". This should still catch some edge cases, and shouldn't be too harmful. What this does not do is identify or solve the reason that we are seeing the empty string in the database at all. From my read on the logic, it must mean that the graph driver is explicitly set to "" in the c/storage config at the time Podman is first run and I'm not precisely sure how that happens. Fixes #24738 Signed-off-by: Matt Heon --- libpod/sqlite_state.go | 24 ++++++++++++++++++++++++ test/system/005-info.bats | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/libpod/sqlite_state.go b/libpod/sqlite_state.go index 1e979727d1..ea42f8e3e8 100644 --- a/libpod/sqlite_state.go +++ b/libpod/sqlite_state.go @@ -383,6 +383,30 @@ func (s *SQLiteState) ValidateDBConfig(runtime *Runtime) (defErr error) { return fmt.Errorf("retrieving DB config: %w", err) } + // Sometimes, for as-yet unclear reasons, the database value ends up set + // to the empty string. If it does, this evaluation is always going to + // fail, and libpod will be unusable. + // At this point, the check is effectively meaningless - we don't + // actually know the settings we should be checking against. The best + // thing we can do (and what BoltDB did in this case) is to compare + // against the default, on the assumption that is what was in use. + // TODO: We can't remove this code without breaking existing SQLite DBs + // that already have incorrect values in the database, but we should + // investigate why this is happening and try and prevent the creation of + // new databases with these garbage checks. + if graphRoot == "" { + logrus.Debugf("Database uses empty-string graph root, substituting default %q", storeOpts.GraphRoot) + graphRoot = storeOpts.GraphRoot + } + if runRoot == "" { + logrus.Debugf("Database uses empty-string run root, substituting default %q", storeOpts.RunRoot) + runRoot = storeOpts.RunRoot + } + if graphDriver == "" { + logrus.Debugf("Database uses empty-string graph driver, substituting default %q", storeOpts.GraphDriverName) + graphDriver = storeOpts.GraphDriverName + } + checkField := func(fieldName, dbVal, ourVal string, isPath bool) error { if isPath { // Tolerate symlinks when possible - most relevant for OStree systems diff --git a/test/system/005-info.bats b/test/system/005-info.bats index ef1c345b29..4887a89422 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -305,4 +305,27 @@ EOF run_podman $safe_opts system reset --force } +@test "podman - empty string defaults for certain values" { + skip_if_remote "Test uses nonstandard paths for c/storage directories" + + # We just want this to be empty - so graph driver will be set to the empty string + touch $PODMAN_TMPDIR/storage.conf + + safe_opts=$(podman_isolation_opts ${PODMAN_TMPDIR}) + + # Force all custom directories so we don't pick up an existing database + CONTAINERS_STORAGE_CONF=$PODMAN_TMPDIR/storage.conf run_podman 0+w $safe_opts info + require_warning "The storage 'driver' option should be set" \ + "c/storage should warn on empty storage driver" + + # Now add a valid graph driver to storage.conf + cat >$PODMAN_TMPDIR/storage.conf < Date: Tue, 11 Feb 2025 11:02:20 -0500 Subject: [PATCH 4/6] Update release notes for v5.4.0 final Signed-off-by: Matt Heon --- RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1d8b7d63ef..f47e4e199b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -50,6 +50,7 @@ - Fixed a bug where it was possible to specify the `libkrun` backend for VMs on Intel Macs (`libkrun` only supports Arm systems). - Fixed a bug where `libkrun` and `applehv` VMs from `podman machine` could be started at the same time on Macs ([#25112](https://github.com/containers/podman/issues/25112)). - Fixed a bug where `podman exec` commands could not detach from the exec session using the detach keys ([#24895](https://github.com/containers/podman/issues/24895)). +- Fixed a bug where Podman would fail to start due to a database configuration mismatch when certain fields were configured to the empty string ([#24738](https://github.com/containers/podman/issues/24738)). ### API - The Compat and Libpod Build APIs for Images now support a new query parameter, `nohosts`, which (when set to true) does not create `/etc/hosts` in the image when building. From f9f7d48b24b1ca4403f189caaeab1cb8ff4a9aa2 Mon Sep 17 00:00:00 2001 From: Matt Heon Date: Tue, 11 Feb 2025 11:03:25 -0500 Subject: [PATCH 5/6] Bump to v5.4.0 Signed-off-by: Matt Heon --- version/rawversion/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/rawversion/version.go b/version/rawversion/version.go index a2f65f18d6..1affbe48a8 100644 --- a/version/rawversion/version.go +++ b/version/rawversion/version.go @@ -7,4 +7,4 @@ package rawversion // // NOTE: remember to bump the version at the top of the top-level README.md // file when this is bumped. -const RawVersion = "5.4.0-dev" +const RawVersion = "5.4.0" From 223f827213f55e551cbb97af2f054b508a335355 Mon Sep 17 00:00:00 2001 From: Matt Heon Date: Tue, 11 Feb 2025 11:04:04 -0500 Subject: [PATCH 6/6] Bump to v5.4.1-dev Signed-off-by: Matt Heon --- version/rawversion/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/rawversion/version.go b/version/rawversion/version.go index 1affbe48a8..0b901642d8 100644 --- a/version/rawversion/version.go +++ b/version/rawversion/version.go @@ -7,4 +7,4 @@ package rawversion // // NOTE: remember to bump the version at the top of the top-level README.md // file when this is bumped. -const RawVersion = "5.4.0" +const RawVersion = "5.4.1-dev"