[Jamie] Fix Host Storage MALFORMED: allow null docker_root_dir/filesystem - #5225
Merged
Conversation
…stem
## Problem
The admin Host Storage panel returns `{"outcome":"failed","reasonCode":"MALFORMED"}` for swarm boxes where the storage collector cannot resolve the Docker root filesystem (e.g. instance `i-0622bd22c313f7227`, also seen on `i-0d7b27a21ef9d3863`).
## Root cause
Confirmed as a Hive-side schema/contract drift, not a box problem:
- The sphinx-swarm `GetHostStorage` command runs successfully on the box and returns a valid `HostStorage` payload. Box log:
`GetHostStorage source=none host_visible=false root_free_bytes=None neo4j_bytes=Some(...) errors=2`
- In the Rust struct (`src/host_stats.rs`), `docker_root_dir` and `docker_root_filesystem` are `Option<String>`. When the docker root cannot be resolved they serialize to `null`.
- In Hive's `hostStorageSchema` (`src/services/swarm/host-storage.ts`), both fields are plain required `cappedString` (`z.string().transform(capString)`) with no `.nullable()`. A `null` value fails `safeParse` → `parseHostStorage` returns `MALFORMED`.
## Fix
Make `docker_root_dir` and `docker_root_filesystem` nullable in `hostStorageSchema` to match the swarm's `Option<String>` contract. This is the same treatment already applied to the `neo4j` field (`z.nullable(...)`).
gonzaloaune
enabled auto-merge (squash)
September 2, 2026 13:36
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.
Problem
The admin Host Storage panel returns
{"outcome":"failed","reasonCode":"MALFORMED"}for swarm boxes where the storage collector cannot resolve the Docker root filesystem (e.g. instancei-0622bd22c313f7227, also seen oni-0d7b27a21ef9d3863).Root cause
Confirmed as a Hive-side schema/contract drift, not a box problem:
GetHostStoragecommand runs successfully on the box and returns a validHostStoragepayload. Box log:GetHostStorage source=none host_visible=false root_free_bytes=None neo4j_bytes=Some(...) errors=2src/host_stats.rs),docker_root_diranddocker_root_filesystemareOption<String>. When the docker root cannot be resolved they serialize tonull.hostStorageSchema(src/services/swarm/host-storage.ts), both fields are plain requiredcappedString(z.string().transform(capString)) with no.nullable(). Anullvalue failssafeParse→parseHostStoragereturnsMALFORMED.Fix
Make
docker_root_diranddocker_root_filesystemnullable inhostStorageSchemato match the swarm'sOption<String>contract. This is the same treatment already applied to theneo4jfield (z.nullable(...)).