Skip to content

Conversation

@norio-nomura
Copy link
Contributor

I hope this change can avoid error stderr="\"\": read |0: bad file descriptor".

An example log in CI:
https://github.com/lima-vm/lima/actions/runs/19009478793/job/54288264005?pr=4275#step:10:206

{"time":"2025-11-02T08:20:01.457239Z","status":{"running":true,"degraded":true,"errors":["failed to satisfy the optional requirement 1 of 2 "systemd must be available": systemd is required to run containerd, but does not seem to be available.\nMake sure that you use an image that supports systemd. If you do not want to run\ncontainerd, please make sure that both 'container.system' and 'containerd.user'\nare set to 'false' in the config file.\n; skipping further checks: stdout="", stderr="": failed to execute script "systemd must be available": stdout="", stderr="": read |0: bad file descriptor"],"sshLocalPort":49262}}

This error is speculated to occur because the stdin is closed before the EOF is detected when read reads stdin. This change tries to reduce the possibility of stdin being closed by separating command substitution from the process of creating stdin to read.

…ng pipe inputs on executing requirements

I hope this change can avoid error `stderr="\"\": read |0: bad file descriptor"`.

An example log in CI:
https://github.com/lima-vm/lima/actions/runs/19009478793/job/54288264005?pr=4275#step:10:206
> {"time":"2025-11-02T08:20:01.457239Z","status":{"running":true,"degraded":true,"errors":["failed to satisfy the optional requirement 1 of 2 \"systemd must be available\": systemd is required to run containerd, but does not seem to be available.\nMake sure that you use an image that supports systemd. If you do not want to run\ncontainerd, please make sure that both 'container.system' and 'containerd.user'\nare set to 'false' in the config file.\n; skipping further checks: stdout=\"\", stderr=\"\": failed to execute script \"systemd must be available\": stdout=\"\", stderr=\"\": read |0: bad file descriptor"],"sshLocalPort":49262}}

This error is speculated to occur because the stdin is closed before the EOF is detected when `read` reads stdin.
This change tries to reduce the possibility of stdin being closed by separating command substitution from the process of creating stdin to `read`.

Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@jandubois jandubois added this to the v2.0.0 milestone Nov 2, 2025
@jandubois jandubois merged commit b79d69a into lima-vm:master Nov 2, 2025
37 checks passed
@norio-nomura norio-nomura deleted the avoid-command-substitution-on-pipe-input branch November 3, 2025 00:32
@norio-nomura
Copy link
Contributor Author

Thanks! 🙏🏻

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.

2 participants