podman machine init
fails if ~/.ssh/ doesn't exist
#14572
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
machine
remote
Problem is in podman-remote
ssh
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Running
podman machine init
in a context where theHOME
directory doesn't contain a .ssh/ folder will cause it to error out without providing any meaningful error output.The chain of events appears to be...
machine.GenerateSSHKeys
generatekeys
ssh-keygen -N "" -t ... -f $HOME/.ssh/...
At least on macOS, that call to ssh-keygen will fail if ~/.ssh/ doesn't exist. The error then gets propagated up until eventually the program exists without ever printing anything useful along the way.
I clearly spent a lot of time debugging this 😅 I'd put up a PR to fix it but I don't really get how error handling in Go works, and I'm not sure what the "right way" to go about it would be. Hopefully I've at least provided enough detail that it'll be easy for someone else to fix.
Steps to reproduce the issue:
Set
HOME
env var to a directory which does not contain a .ssh/ folderRun
podman machine init
Describe the results you received:
Error output just says...
...which is super unhelpful
Describe the results you expected:
Should probably just assert that the directory exists before calling
machine.GenerateSSHKeys
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):N/A, on macOS, installed through
brew
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes/No
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: