coder / coder/registry

mux: forced package_manager check fails use_cached starts when the package manager is missing

Open
#1,099 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
HCL
Stars
79
Forks
161
Avg merge
1d 10h
Merged PRs (30d)
38

Description

Follow-up from https://github.com/coder/registry/pull/1095 (review thread https://github.com/coder/registry/pull/1095#discussion_r3928942908).

`scripts/install.sh.tftpl` validates a forced `package_manager` (`command -v "$PM_CMD"`) right after the offline check, before it looks at the cached binary. With `use_cached = true`, a valid Mux install and a rebuilt image that no longer ships the configured package manager, the script exits with "Configured package manager '...' not found on PATH" even though `use_cached` promises to run whatever copy is present without touching the registry.

Proposed change: keep the package-manager detection where it is (the version lookup needs `PM_CMD`), but move the hard failure for a missing forced package manager to the `NEEDS_INSTALL = true` branch. When `use_cached` short-circuits, the check is never reached; when the version lookup cannot resolve because the package manager is missing, the install branch fails with the same message as today. Add a container test: forced `package_manager`, `use_cached = true`, binary present, package manager absent, expect the start to succeed.

> Xum acted on behalf of @ibetitsmike when filing this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.