Skip to content

Fix rogue cert directories causing EISDIR on start - #488

Merged
AaronFeledy merged 7 commits into
mainfrom
fix/486-rogue-cert-dirs
Aug 10, 2026
Merged

Fix rogue cert directories causing EISDIR on start#488
AaronFeledy merged 7 commits into
mainfrom
fix/486-rogue-cert-dirs

Conversation

@AaronFeledy

@AaronFeledy AaronFeledy commented Aug 9, 2026

Copy link
Copy Markdown
Member

Fixes #486

Docker creates missing bind-mount sources as directories. The v3 lando service bind-mounts ~/.lando/certs/<id>.<project>.crt|key whenever ssl: true, but those files are only generated at pre-start, so if Docker ever touches those mounts while the files are missing it leaves rogue directories behind — and cert generation then dies with EISDIR on every subsequent lando start/rebuild.

The first commits add a deterministic repro to the certs leia spec (rogue dirs at the cert paths before lando start), which failed CI with the exact error from the issue (failing run):

ERROR ==> EISDIR: illegal operation on a directory, open '/home/runner/.lando/certs/web.landocerts.crt'

Then the fix, in two layers:

  • Recoveryutils/write-file.js now removes a directory sitting at the target path before writing. Existing files are never removed so bind-mounted files keep their inode across rewrites, preserving the Proxy - error mounting /certs/cert.key #242 WSL fix. Unit tests cover both behaviors.
  • Preventionbuilders/_lando.js ensures the cert paths exist as (possibly empty) files before they are ever bind-mounted, so Docker can no longer fabricate directories there in the first place.

@netlify

netlify Bot commented Aug 9, 2026

Copy link
Copy Markdown

Deploy Preview for lando-core failed. Why did it fail? →

Name Link
🔨 Latest commit 285b6d7
🔍 Latest deploy log https://app.netlify.com/projects/lando-core/deploys/6a7917bdecd7d60008fb2bdd

@AaronFeledy
AaronFeledy merged commit 79ea689 into main Aug 10, 2026
71 of 75 checks passed
@AaronFeledy
AaronFeledy deleted the fix/486-rogue-cert-dirs branch August 10, 2026 01:23
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.

EISDIR error when cert path is a directory instead of a file

1 participant