Skip to content

tools image: check health is CRITICAL because composer cannot list (no global composer.json) #56

Description

@SYKhayyat

Classification: test-infrastructure problem (image build). The composer backend is behaving correctly on an uninitialized composer; the image never initializes composer's global project, and the harness has no soft path for it. A product-adjacent question is whether the backend should degrade more gracefully, but the red gate is the image's.

The problem

The tools image fails check health in section [2] (rc=2, "Some checks are CRITICAL"). The critical backend is composer:

[FAIL] composer — says it is ready but cannot list: `composer` answered with 0 line(s) this
parser does not recognise, the first being `not JSON: `. Its output format has probably changed.
This is not read as an empty machine: that reading would plan every declared package as a fresh
install and drop every removal.

Reproduced directly on the built image (shall-it-tools):

$ composer global show --format=json
Changed current directory to /root/.config/composer
Composer could not find a composer.json file in /root/.config/composer

Root cause

Dockerfile.tools installs composer (apt composer, line 36) but never initializes a global composer project. The composer backend's list verb is global show --format=json (src/backends/builtin_backends.toml:48), and with no composer.json in the global config dir composer prints an error instead of JSON. The health probe correctly reports the unparseable output and promotes the backend to CRITICAL, so the harness's ok "check health" lx check health assertion (rc=0) fails.

Fix

Initialize the global composer project during the image build (seed /root/.config/composer/composer.json so composer global show returns a valid empty JSON tree), or give composer the same soft "no real lifecycle here" treatment in the harness that the other un-drivable managers get.

Evidence

  • linux_run.txt:9136–9144 (the harness failure).
  • Reproduced against shall-it-tools (composer is the only [FAIL]/critical backend in shall check health).
  • builtin_backends.toml:45–56 (list_args = global show --format=json).

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions