GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error · Issue #6388 · developing-today/code

deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error #6388

New issue
Copy link
New issue
Copy link
Closed
#6389
Closed
deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error#6388
#6389
Copy link
Labels
app/deployPackage/app: deploy (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 5, 2026
Issue body actions

deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error

pkgs/deploy/deploy.py's module docstring states the contract: validation "is the oracle for 'well-formed definition'… Any violation is reported by field and makes list exit non-zero". For two fields, a wrong-typed value does not get a field report at all — validate() itself raises, deploy list dies with an unhandled traceback, and no validation errors (including unrelated, correctly-detectable ones in other services) are ever printed.

Verified on the laptop against origin/main (5c56f76; the file at the laptop primary's HEAD is identical for these lines) with a probe driving the real deploy.py against hand-written registries (probe: ~/git/fleet/probe-deploy-validate-crash/ on the laptop):

The defect

  • deploy.py:125 — if "restart" in defn and defn["restart"] not in RESTART_POLICIES: — RESTART_POLICIES is a set (deploy.py:30). Set membership hashes the candidate, so a JSON array or object value is unhashable.
  • deploy.py:144 — the same shape for class against CLASSES (a set, deploy.py:29).

Every other field check in validate() guards with isinstance(...) before use (e.g. ports requires isinstance(p, int), healthCheck requires isinstance(hc, str) before startswith); the two set-membership checks are the only ones that consume the raw value unguarded.

Observed behavior (real deploy.py, probe registries)

  • Valid control registry → exit 0, normal table.
  • "restart": ["always"] → exit 1 with an unhandled traceback ending TypeError: cannot use 'list' as a set element (unhashable type: 'list') — no deploy: invalid definition: line.
  • "class": {"x": 1} → exit 1, traceback ending TypeError: cannot use 'dict' as a set element (unhashable type: 'dict').
  • "class": ["systemd"] → same list crash.
  • "restart": 5 (hashable but wrong) → correctly reported: exit 1, deploy: invalid definition: service 'svc': restart must be one of … — so the crash is specific to unhashable JSON values (arrays/objects), the exact shapes a hand-authored or generated registry typo produces.
  • Because the exception escapes validate() (called from cmd_list, deploy.py:167; main() catches only load errors), one crashing service also suppresses the field reports for every other service in the same registry: the registry author gets a Python traceback pointing into the validator instead of the list of what's wrong with their definitions.

Why it matters

validate() is the stated oracle that every later #5766 slice trusts (renderers and activation consume class/restart verbatim). A validator that crashes on malformed input inverts its job: the malformed registries are precisely the ones it exists to explain. The traceback also leaks implementation detail (set internals) as the only diagnostic, in a CLI whose other failure paths (cannot load registry, per-field invalid definition: lines) are deliberately clean.

Distinct from #6383 (same file): that issue is validate() accepting invalid shapes with exit 0 (newline names, duplicate targets/secrets, host-less healthCheck). This one is validate() crashing on invalid shapes — opposite failure mode, different lines, different fix.

Acceptance criteria

  • validate() returns field-named errors (existing style) for non-string restart and class values — including arrays and objects — and deploy list exits 1 with those deploy: invalid definition: lines and no traceback.
  • A registry mixing a crashing-shape service with another service's ordinary error reports both services' errors in one run.
  • Sane controls unchanged: the shipped registry (pkgs/deploy/services.nix via the flake) still validates; a hashable wrong value ("restart": 5, "restart": "sometimes") still gets the existing "must be one of" error.
  • Regression coverage: extend the malformed-registry flake check (deploy-list-malformed, lib/default.nix) or add an equivalent case exercising array/object restart and class values.

Related: #6383 (validate() accepts-shapes class, same file), #6384 (duplicate-key load rejection, fixed), #5766 (the deploy tool epic this validation gates).

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/deployPackage/app: deploy (pkgs/ or apps/ in this repo)
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    developing-todayBot
    on Nov 5, 2026 – with developing.today
    Contributor
    More actions

    CODE-1903

  3. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-05 16:20 CST
    • Found via: filed this run
    • Task: Filed after verifying on the laptop against origin/main (5c56f76) that deploy.py validate() (pkgs/deploy/deploy.py:125/:144) raises an unhandled TypeError on unhashable restart/class values instead of returning field-named validation errors; probe ~/git/fleet/probe-deploy-validate-crash (real deploy.py): restart list / class dict / class list all traceback, valid control exit 0, restart=5 control correctly reported.
    • Expectation: effort s — triage confirms, then a bounded fix (isinstance guards mirroring the other field checks) plus malformed-registry regression coverage.
    • Links: queue packet packet-6388-fix.json (hidden_files)
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 5, 2026
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-u
    • Session / ID: task 10796
    • Found via: queue claim (direct execution lane)
    • Task: Implementing task 10796 for issue deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error #6388: isinstance guards before the restart/class set-membership checks in pkgs/deploy/deploy.py validate(), plus regression coverage in the deploy-list-malformed flake check.
    • Expectation: crashing registries exit 1 with field-named errors and no traceback; valid and hashable-wrong-value controls unchanged.
    • Links: task 10796 · issue deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error #6388
  6. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: new-issue-creator job (new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-05 16:20 CST
    • Found via: self-assigned during new-issue-creator-code-b run (guarded self-solve, lifecycle protocol §4 — filed this run, trivial, no safety labels)
    • Task: Guard the restart/class set-membership checks in validate() with isinstance checks so unhashable values produce field-named errors; extend the deploy-list-malformed flake check with array/object restart+class cases. Queue task 10796 is being cancelled as self-assigned.
    • Expectation: effort xs — done = PR merged, probe registries exit 1 with field errors and no traceback, controls unchanged.
    • Links: branch creator-b/6388-validate-unhashable (PR to follow)
  7. dezren39
    added
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 5, 2026
  8. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: new-issue-creator job (new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-05 16:20 CST
    • Found via: filed this run
    • Task: Standing down from the guarded self-solve I announced in my pickup note: the queue worker claimed task 10796 and posted its pickup note (6671265081) before mine, so it is the first holder and keeps the item (lifecycle protocol §6 double-assignment rule). I created no branch and changed no code. Removing my work/self-assigned label; the worker's queue/claimed + work/assigned stand.
    • Expectation: effort s — the queue worker's task 10796 completes the fix.
    • Links: task 10796 (repo-health-code-pilot)
  9. dezren39
    removed
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 5, 2026
  10. dezren39
    closed this as completedin #6389on Nov 5, 2026
  11. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane code-u
    • Session / ID: task 10796
    • Found via: queue claim (direct execution lane)
    • Task: Fixed task 10796 for issue deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error #6388 in PR fix(deploy): validate() reports unhashable restart/class values by field instead of crashing #6389, merged as cb8eee8. validate() now guards the restart/class set-membership checks with isinstance(str), so unhashable values get the existing field-named errors instead of a TypeError traceback; deploy-list-malformed flake check extended with an unhashable registry (both services' errors in one run, no traceback asserted). Codex review on PR fix(deploy): validate() reports unhashable restart/class values by field instead of crashing #6389 completed with no findings.
    • Expectation: done — issue deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error #6388 closed by the merge.
    • Links: task 10796 · PR fix(deploy): validate() reports unhashable restart/class values by field instead of crashing #6389 · issue deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error #6388
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 5, 2026
  13. developing-today
    added
    status:done
    on Nov 5, 2026
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

    app/deployPackage/app: deploy (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.