-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no route to host #221
Comments
Are those private or public ip addresses? Would this happen if you say ran |
I've run into this with different topologies, but currently I have a regular Mac running the bridge and a guest VM on that same Mac running Bluebubbles. Both the host Mac and the guest Mac are on the LAN with local IP address. Sleep is completely disabled on both. I suspect the issue may be that the bridge is occasionally/randomly picking the wrong network interface. I can telnet from the host to the guest IP address and Bluebubbles port, and I can ssh from the host to the guest IP address, at the same time that the bridge is reporting no route to host. So I think the bridge is incorrectly and inconsistently determining how to access this IP address, maybe because it doesn't have logic for selecting the right nic? But to answer your question directly: both the bridge and Bluebubbles/iMessages are running on private/LAN internal IP addresses (192.168...). Those two boxes can ping, telnet, and ssh each other, even when the Bridge is reporting no route to host. |
I would suspect the bridge (golang networking libraries) to pick whatever interface is in your route tables. You could possibly run Another thing to make check and I'm sure you already did this but you're using ip addresses rather than domain names local or otherwise right? And no routers sitting between the 2 macs (though I'm sure you probably have some switches)? Lastly, maybe your computers are switching from 5ghz to 2.4ghz and that's breaking the websocket...though there is a retry mechanism but I know for a fact we haven't tested for that kind of edge case. |
In the current configuration, the two Macs are literally the same box. There is the host (real) Mac running the bridge, and then the guest (VM) Mac running iMessages/Bluebubbles. So there is no network infrastructure (WiFi, Ethernet, or otherwise) in between them. And the bridge is only referencing the virtual Mac via hard-coded IP address. I can try running |
I should also mention: I think when this happens if I disable WiFi on the Mac and then restart the Bridge, it's fixed. But the problem is inconsistent enough that I'm not sure if it's a coincidence. The Mac has both an Ethernet and a WiFi connection (the latter is necessary for features like unlock-with-Apple-Watch even if you have a hardwired Ethernet connection), but the Bridge should only be communicating with the VM Mac that is running on the same device with its own IP address in the same subnet. |
Oh that's a completely different setup than I imagined and renders all of my clarifying questions moot. The host<->vm route is definitely not going to randomly change. This might be out of my depth. Is there any hint of the retry mechanism kicking in at least? If not then that might be something we could add. Right now it'll retry if the connection is lost which I assume differs from your case in the sense that the bridge still has a valid route for its next attempts. You haven't timed how long it takes to lost the connection have you? It couldn't be the vm going into sleep mode? I know that UTM has options like that and also noticed people saying |
I have sleep disabled on both the host and the guest. I'm pretty sure neither is sleeping -- they both respond instantly to ssh. Also, if it were really a sleep thing, shouldn't it start working after they wake up, i.e. once I'm logged into both with ssh? In my case, the "no route to host" seems to persist indefinitely until, at least, I kill a relaunch the bridge. And as to your retry question: it doesn't seem like retry ever succeeds. It just keeps reporting no route to host. |
Per your suggestion above, I just ran The host machine is
|
Your arp output looks good. When you say they both respond to ssh, are you initiating a new connection? Because that can and should trigger wake-on-lan and I believe behaves differently from trying to re-establish an existing one, which is what the bridge does. Any chance you could run amphetamine on the host and VM for a day to see if that has any effect? Otherwise I need to brush up on my networking and dig into how the retry mechanism works under the hood. |
Yes, I'm establishing a new connection via ssh or telnet to the bridge IP & port. This has happened while I'm actually logged in to both boxes and watching the logs on each, so I don't think it could possibly be sleep, but I will try amphetamine just to definitively rule that out. I also noticed occasionally a different error:
|
It's not sleep then. Must be VM related. |
I suppose it could be VM related although I was getting this same problem a while back when I had the bridge and BB running on two real devices. It seems like there must be something with the go network stack, no? |
My new working theory is a recently-added MacOS Sequoia security feature that blocks applications from LAN access unless they specifically request an entitlement. I'll dig some more and report back. |
I think I'm getting close. It appears if I launch the bridge from the terminal on the Mac, it's fine. If I launch the bridge as a cron job or in a screen session, it is eventually blocked from accessing the local network, which includes the hosted VM but would also occur if the bridge were running on another box in my LAN. Sequoia introduced a security feature that blocks apps from accessing the local network without first requesting and receiving user permission. So I think to eliminate this problem, mautrix-imessages needs to trigger the permissions request. Otherwise at least in some circumstances the OS will prevent it from accessing local IP addresses. Anyone know if that is even possible when running a locally compiled go executable, as opposed to a .app type package? |
Here's a Reddit thread about the overall issue. |
That's very strange that it would let you access it for a while and then revoke the permission or cut off the connection. I have seen this issue with users using systemctl to turn their bridge into a service, so you might be right that it breaks when not run directly. Out of curiosity, what are you using to run your VM? /edit btw I run a vm as well but everything including bluebubbles + bridge run on it. The github page for the qemu tooling around it also recommends using Ventura but I can't say for sure why: https://github.com/kholia/OSX-KVM Here are some tweaks for running a vm on a macos host: https://github.com/kholia/OSX-KVM/blob/master/notes.md#tweaks-for-macos |
Based on further experimentation, it seems to be something about how the bridge (and perhaps other go apps) seek local network access. When I get this error, if I start a So my takeaway is MacOS is looking at the context from which a LAN connection request is made and deciding to selectively block it, and when I run mautrix-imessages from a visible terminal window, it's fine, but when it's launched in the background, it gets blocked. The fix, if possible, would be for mautrix-imessages to get full LAN access permissions in Sequoia, possibly by requesting and receiving it from the user. Anyone know how to do that?
VMWare Fusion, although this issue appears to be unrelated to the VM or even Bluebubbles. I have MacOS/iMessages/Bluebubbles running in a VM to minimize exposure on a SIP-disabled device. I've used QEmu in the past but it stopped working for me at some point with MacOS upgrade and then I started getting kicked out of iCloud with my virtual device. The VMWare Fusion box, which I installed from a fresh Sonoma image and then upgraded to Sequoia, has been stable so far and not iCloud issues. |
I think you nailed it. Are you running the bridge manager or the imessage bridge directly? Cause that'll add a layer. No firewall too I suppose? I just looked at Privacy & Security tab in system settings and you can't manually add a binary unfortunately. I'm confused by the outcome of mjtsai's post because it seems to imply that accepting the prompt (if there is one) doesn't work but also that it needs to request local network permissions.
Otherwise yea, maybe we can add this. |
I was running the bridge either directly from the command-line or as a cron job. It seems to work fine from terminal window but not in a screen session or from cron. Presumably terminal.app at some point sought and received LAN permission, and a process run from "bare" terminal inherits those permissions, but not in screen or from cronjob. I have firewall completely disabled. |
That article you posted also mentioned using launchd as root but that's probably not something you want to do. |
Yeah, I'm trying to keep the pieces as isolated as possible--running BB in VM, and then running the bridge on a separate unprivileged account. For now, I can just move the bridge to a Linux box as that seems to work fine. It can still talk directly over the LAN to BB in the Mac VM running on the real Mac. But hopefully we can fix the underlying permissions issue so others don't get stuck. |
Running the bridge on MacOS connecting to another MacOS box running the Bluebubbles server, I periodically get the error:
When this happens, the Bluebubbles server appears to be running fine. And I can access that server from the box running the bridge by telnetting to the Bluebubbles port (i.e., here
telnet server-ip-address 1234
). But for some reason the bridge reports "no route to host" with the same IP address and port.I'm not sure how to isolate the cause of this error but am happy to run further diagnostics to identify it.
The text was updated successfully, but these errors were encountered: