Skip to content

[Jamie] Fix Host Storage MALFORMED: allow null docker_root_dir/filesystem - #5225

Merged
gonzaloaune merged 2 commits into
masterfrom
swarm/swarm-change-3d901ce2
Sep 2, 2026
Merged

[Jamie] Fix Host Storage MALFORMED: allow null docker_root_dir/filesystem#5225
gonzaloaune merged 2 commits into
masterfrom
swarm/swarm-change-3d901ce2

Conversation

@gonzaloaune

Copy link
Copy Markdown
Collaborator

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 safeParseparseHostStorage 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(...)).

…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 gonzaloaune added the jamie Automated PR opened by Jamie label Sep 2, 2026 — with Hive Chat PM
@gonzaloaune
gonzaloaune enabled auto-merge (squash) September 2, 2026 13:36
@gonzaloaune
gonzaloaune merged commit 3f31cee into master Sep 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jamie Automated PR opened by Jamie

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants