I used PuTTY Key Generator to generate a 4096 bit RSA-2 key with a passphrase.
I save the .ppk and an openSSL format public key. The putty format public key doesn\'t
The error is misleading - it says "pubkey" while pointing to a private key file ~/.ssh/id_rsa.
In my case, it was simply a missing public key (as I haven't restored it from a vault).
I used to skip deploying ~/.ssh/id_rsa.pub by automated scripts.
All ssh usages worked, but the error made me think of a possible mess.
Not at all - strace helped to notice that the trigger was actually the *.pub file:
strace ssh example.com
...
openat(AT_FDCWD, "/home/uvsmtid/.ssh/id_rsa.pub", O_RDONLY) = -1 ENOENT (No such file or directory)
...
write(2, "load pubkey \"/home/uvsmtid/.ssh/"..., 57) = 57
load pubkey "/home/uvsmtid/.ssh/id_rsa": invalid format