Fix operational get-data crash on containers with shell chars#1509
Open
rical wants to merge 1 commit into
Open
Fix operational get-data crash on containers with shell chars#1509rical wants to merge 1 commit into
rical wants to merge 1 commit into
Conversation
de177ec to
a015e1b
Compare
Contributor
|
This feels like a bandaid fix, the core problem is that containers is not removed when change configuration to test config, right? Or what did you find out in your investigation @rical? |
wkz
reviewed
May 19, 2026
Contributor
Author
Yes, I totally agree. I rushed this. I'm normally the advocacy of aggressive pruning in the pursuit of immutability :) I will drop the commit from this PR. Rewrite the test to fail if it finds dangling containers and submit it in another PR, so we can merge the actual fix in this PR. |
a015e1b to
e8e8fab
Compare
The 'command' leaf is config, with a strict pattern that doesn't allow '&', quotes or pipes. Yanger was populating it from podman's full, untruncated container command -- so any container whose entrypoint uses shell metacharacters (e.g. sh -c "... && ...") failed YANG validation. The symptom: every operational read of /infix-containers:containers returns SR_ERR_INTERNAL, which in turn fails the whole get-data on the operational datastore. This breaks case/misc/operational_all and any RESTCONF/NETCONF read that touches containers. This was introduced in 59028c4 ("Fix #1466: 'show container' shows no output"), which added the operational, pattern-less 'cmdline' leaf but left the old 'command' assignment in place. Drop it -- 'cmdline' already carries the full command line, and 'command' belongs to running config. Note: the failure can look intermittent across test runs because podman storage is persistent. It only triggers once a container with a bad-pattern command ends up in 'podman ps -a', including stale or exited leftovers from earlier runs. Signed-off-by: Richard Alpe <richard@bit42.se>
e8e8fab to
bcc2df7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Yanger was populating a strict-pattern config leaf from podman's full entrypoint, breaking every operational read of containers whose command contained characters disallowed by the pattern. To fix this, we simply remove "command" from the data as "command" is config not operational.
Checklist
Tick relevant boxes, this PR is-a or has-a: