Skip to content

[BUG] Clearing Command (optional) on Edit container does not persist after Update #1489

Closed

Description

@sysnapse

Description

In Edit container → Update container, clearing the optional Command field (non-empty → empty) appears to succeed, but the container still runs the previous command. Re-opening Edit shows the old value; it never becomes empty / image default.

This is the same “empty means absent, not cleared” merge as #1119 / #747 / #892, but Command was not included in the #1119 null-vs-omit fix.

In EditContainerModal.svelte, the update payload comment already documents the contract:

send null when the user cleared them so the server can distinguish "cleared" from "absent" (#1119). … explicit null = clear; undefined would be dropped by JSON.stringify and the merge would preserve the old value.

env, memory, user, etc. follow that (?? null / || null). Command does not:

const cmd = command.trim() ? parseShellCommand(command.trim()) : undefined;
// …
const payload = {
  // …
  cmd,  // omitted from JSON when empty → server keeps old Cmd
};

Expected: empty Command → send cmd: null → recreate without a user override so Docker uses the image CMD.

Not a duplicate of #1371 (that was auto-update keeping the old image Cmd when the new image Cmd changed).

Steps to reproduce

  1. Create or edit a container and set Command (optional) to a non-empty override (e.g. sleep 9999). Update container.
  2. Confirm inspect / Edit still shows that command.
  3. Edit container again. Clear Command (optional) so the field is empty.
  4. Click Update container.
  5. Re-open Edit (or docker inspect Config.Cmd).

Expected

Command is empty / image default CMD.

Actual

Command remains the previous override. Update reports success.

Logs

N/A — UI-only; no Dockhand error. The POST /api/containers/{id}/update body omits `cmd` when the field is cleared (JSON.stringify drops `undefined`). When Command is filled, `cmd` is an array in the same body.

Browser logs

N/A — compare the update POST: cleared Command has no `cmd` key; non-empty Command has `"cmd": [ … ]`.

Dockhand version

Current main (EditContainerModal.svelte still uses cmd = … : undefined). Please fill Settings → About if you need a specific build.

Hawser version (if used)

No response

Connection mode

socket (likely irrelevant; payload is built in the UI)

Please confirm the following

  • I have already searched for relevant existing issues and discussions before opening this report.
  • I have updated the title field above with a concise description.

Activity

  1. added
    bugSomething isn't working
    ready to gofixed, goes to the next release
    on Sep 21, 2026
  2. added theissue type on Sep 21, 2026
  3. added this to the 1.0.49 milestone on Sep 21, 2026
  4. jotka commented on Sep 23, 2026

    @jotka
    Contributor

    released

    • fnsys/dockhand:v1.0.49
    • fnsys/dockhand:latest
    • fnsys/dockhand:v1.0.49-baseline
    • fnsys/dockhand:latest-baseline
    • fnsys/dockhand:baseline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready to gofixed, goes to the next release

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions