Repository navigation
fix(containers): give a container without stats a default decoration - #3768
Merged
RazCrimson merged 3 commits intoOct 2, 2026
Conversation
A restarting container comes back with empty cpu and memory stats, so its
views stayed {'cpu': {}, 'mem': {}}. The WebUI calls toLowerCase() on the
decoration and threw, which removed the whole container table from the page.
RazCrimson
requested changes
Sep 29, 2026
A container view without a decoration made getDecoration() throw on toLowerCase(), which removed the whole container table. Fall back to DEFAULT like curses does instead.
RazCrimson
reviewed
Sep 30, 2026
Comment on lines
+13
to
+16
| option='decoration'), and plugin-containers.vue reads the same two entries. In | ||
| curses a missing decoration is silent: get_views() answers 'DEFAULT' for a key it | ||
| cannot find. The WebUI calls toLowerCase() on it, so an entry without one breaks | ||
| the whole container table. |
Collaborator
There was a problem hiding this comment.
I believe we have fixed this now with the extra checks you added, so the webui behaviour aligns with the earlier comment.
Wouldn't the comment change be misleading now?
Contributor
Author
There was a problem hiding this comment.
Right, with the fallback the original docstring is true again. Restored it in 5e5189e.
With the WebUI fallback from 7e70dd1 a missing decoration is silent in both front ends again, so the original docstring is right.
RazCrimson
approved these changes
Sep 30, 2026
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
Since #3724 (4.5.7) the WebUI reads the container cpu/mem decorations. A restarting container comes back from Docker with empty
cpuandmemorydicts, soupdate_views()left its views as{'cpu': {}, 'mem': {}}andgetDecoration()throws ondecoration.toLowerCase(). The whole CONTAINERS section disappears as long as any container is restarting.The views now start with
DEFAULT, same as the baseupdate_views()and whatget_views()already gives curses for a missing decoration. New test intests/test_plugin_containers_views.py, it fails withKeyError: 'decoration'without the change. I also updated the module docstring there, it said a missing decoration is silent in both front ends.Checked in the browser on the 4.5.7 image with a
--restart alwayscontainer that keeps exiting: without the change the section was gone in 30 of 30 samples (TypeError: Cannot read properties of undefined (reading 'toLowerCase')), with it the section stayed in 30 of 30, no console errors.ruff check/ruff format --checkclean.pytest tests(without the selenium/TUI ones): same 15 failures as develop, all intest_actions_sanitize.py(missingchevronextra here), plus the new test passing.If you'd rather also guard
getDecoration()in the Vue component, happy to add that.Resume