It’s also slow in general – flyctl ssh console -c 'ls' takes about 5 seconds.
I have a workaround so this isn’t a big issue – just using plain ssh (ssh -o "StrictHostKeyChecking=no" root@mess-with-dns.internal) is working every time` and is a lot faster (maybe 500ms instead of 5s).
Hrm. Curious. I’ve got enough info from your debug dump to do some hunting, but yeah, for future reference: your “interactive” WireGuard peers (the ones flyctl makes for you; they all have interactive in the name) are effectively disposable; if you delete them, flyctl (and flyctl agent) will notice and just make a new one for you. So if you’re seeing WireGuard-related wonkiness, you can always just flyctl wireguard reset to shake off the misbehaving peer connection.
But of course, this shouldn’t be happening in the first place!
For my mental model: are the Wireguard not peers not used when I do ssh root@mess-with-dns.internal? (I’m a bit confused about why one way of sshing worked and the other way didn’t)
It’s a good question. If you can use native ssh, a la ssh root@mess-with-dns.internal, you’ve got a “static” WireGuard peer set up that you created explicitly with flyctl wireguard create, added to your host WireGuard, and set up the DNS for. Presumably, you either have that WireGuard connection always-on, or explicitly turn it on before working with stuff in your organization.
When you use flyctl ssh console, we run WireGuard for you, in userland, behind the scenes (along with a complete TCP/IP stack). We keep those WireGuard connections in the flyctl agent, which is just a program that runs in the background that tries to keep WireGuard peers available and shareable across different invocations of flyctl.
So when you’re using flyctl ssh console, you’re asking the flyctl agent to enable the WireGuard peer (creating it if it isn’t already there), then probe it to see if it’s live (we do a trial DNS query across it to make sure it’s working), and only then make the actual 22/tcp SSH connection.
If flyctl agent’s WireGuard probe fails, we start over from the top, creating a new WireGuard peer (which will add a couple seconds of latency as we orchestrate the peer in our backend), probing it, and only then make the new connection.
The advantage to flyctl ssh console is that you don’t need root to set it up, and don’t have to change any configuration on your dev machine. But native WireGuard will always be faster, and probably? more reliable, though flyctl ssh should always eventually work.