Skip to content

Installer fails with exit status 42 (EXDEV) when $HOME is on a different filesystem than /Applications #395

@jnalv414

Description

@jnalv414

Summary

Docker Desktop's installer uses rename(2) to move the staged Docker.app into /Applications/Docker.app. On macOS systems where the user's home directory is relocated to a non-system volume (e.g. an external drive mounted under /Volumes/...), this rename fails with EXDEV ("cross-device link"). The installer surfaces this as a generic exit status 42 and the corresponding "Docker Desktop - Unable to install" dialog with no actionable detail.

The bug affects both first-time installation and auto-updates. Once an update fails, the prior bundle is left at /Applications/Docker.app.back and the install state directory ~/Library/Application Support/com.docker.install/ is wiped, leaving Docker Desktop unable to launch at all.

Environment

  • macOS 26.5 (build 25F71), Apple silicon (arm64)
  • Docker Desktop 4.73.0 (installed via brew install --cask docker-desktop)
  • $HOME on /Volumes/HOME-EX/Users/<user>/ (APFS, separate physical disk from system volume)
  • /Applications on the standard system data volume
$ df /Applications/ ~/Library/Application\ Support/
Filesystem   ...  Mounted on
/dev/disk3s5 ...  /System/Volumes/Data
/dev/disk8s1 ...  /Volumes/HOME-EX

Reproduction

  1. Relocate $HOME to a non-system APFS volume (System Settings → Users & Groups → advanced options, or a fresh user with home on an external drive).
  2. Install Docker Desktop from any source (Homebrew cask, official DMG, in-app updater — all reproduce).
  3. Launch Docker.app.

Expected

Docker Desktop installs/updates and the engine starts.

Actual

The installer crashes immediately. Smoking-gun log line from ~/Library/Containers/com.docker.docker/Data/log/host/install.log:

[install][W] renaming (moving) file from <HOME>/Library/Application Support/com.docker.install/in_progress/Docker.app
              to /Applications/Docker.app:
              rename <HOME>/Library/Application Support/com.docker.install/in_progress/Docker.app /Applications/Docker.app:
              cross-device link
[install][W] exit status 42

The user-facing dialog only shows "exit status 42" with no hint of the underlying EXDEV.

Suggested fix

In mac/tools/install/main.go (and any equivalent path-move calls), wrap os.Rename with an EXDEV fallback to copy + unlink:

if err := os.Rename(src, dst); err != nil {
    if linkErr, ok := err.(*os.LinkError); ok && errors.Is(linkErr.Err, syscall.EXDEV) {
        // fall back to copy + remove for cross-filesystem moves
        if err := copyDir(src, dst); err != nil { return err }
        return os.RemoveAll(src)
    }
    return err
}

Secondary suggestion: surface the underlying error in the user-facing dialog instead of "exit status 42". Just including the wrapped error message would have made this self-diagnosable.

Workaround

Symlink the staging directory onto the same filesystem as /Applications before launching:

rm -rf ~/Library/Application\ Support/com.docker.install
mkdir -p /Users/Shared/com.docker.install
ln -s /Users/Shared/com.docker.install ~/Library/Application\ Support/com.docker.install
# also clear stale error state if a prior install failed:
rm -f ~/Library/Containers/com.docker.docker/installer.error.json

After this, install and updates succeed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions