Skip to content

fix(daemon): report skip instead of null when Docker.app is missing - #508

Draft
jordan8037310 wants to merge 1 commit into
lando:mainfrom
jordan8037310:fix/null-desktop-version
Draft

jordan8037310 wants to merge 1 commit into
lando:mainfrom
jordan8037310:fix/null-desktop-version

Conversation

@jordan8037310

Copy link
Copy Markdown

Fixes #138.

On macOS, lando crashes with Cannot read properties of null (reading 'trim') when /Applications/Docker.app is missing, for example on OrbStack or Colima without Docker Desktop installed.

Cause

  • daemon.getVersions() reads the version from Docker.app/Contents/Info.plist. When the file is missing it returns desktop: null.
  • utils/is-compatible-version.js then calls semver.clean(null), which throws.
  • daemon.up() also calls semver.gte(null, …), so Lando cannot autostart the engine either.

Change

  • getVersions() returns desktop: 'skip' when the plist cannot be read. This is the convention the win32/WSL branch already uses when componentsVersion.json is missing, and engine.getCompatibility() already drops skip entries.
  • up() only takes the docker desktop start path when the version is valid semver. Otherwise it falls back to open /Applications/Docker.app as before.
  • is-compatible-version returns false for a null or unparseable version instead of throwing.

No behavior change when Docker Desktop is installed.

Validation

  • New specs:
    • test/is-compatible-version.spec.js covers in-range, out-of-range, and null/undefined/'skip'.
    • #getVersions cases in test/daemon.spec.js: the plist read fails → skip, and the plist returns 4.85.0 → 4.85.0.
  • Each spec fails on main and passes with the change.
  • npm test on Node 20: lint clean, all unit specs pass.
  • Manual: on macOS with only OrbStack installed and running, lando start no longer throws, and no Docker Desktop version warning is shown.

🤖 Generated with Claude Code

On macOS without /Applications/Docker.app (e.g. OrbStack or Colima only),
getVersions() returned desktop: null and is-compatible-version threw
"Cannot read properties of null (reading 'trim')". Report 'skip', as the
win32 branch already does, guard the semver check in up(), and treat an
unparseable version as incompatible instead of throwing.

Fixes lando#138

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 15, 2026

Copy link
Copy Markdown

👷 Deploy request for lando-core pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit b12ed84

@github-actions

Copy link
Copy Markdown
Contributor

Privileged Leia tests skipped

The l337 and lando-v4 Leia suites verify authenticated SSH cloning and need the deploy key, so they do not run for fork pull requests.

After reviewing b12ed84aa0235323c03a9a39db7e16b33d7c0ff5, a maintainer can run them against it with:

gh workflow run pr-core-tests.yml --repo lando/core -f pull_request=508 -f commit_sha=b12ed84aa0235323c03a9a39db7e16b33d7c0ff5

or from the workflow page using the same inputs. This comment updates when new commits are pushed and the dispatch only accepts the current head commit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OrbStack not working with Lando.

1 participant