Skip to content
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

[MacOS]: Websocket infinite reconnection for locally hosted instance, all browsers are affected #1632

Closed
SpaghettiC0des opened this issue Oct 30, 2023 · 30 comments
Labels
⚡ Type: Bug Something isn't working

Comments

@SpaghettiC0des
Copy link

Mainsail Version:

2.8.0

Browser:

Safari

Device:

Laptop

Operating System:

macOS

What happened?

The issue was initially posted here Arksine/moonraker#726 and Rat-OS/RatOS#106.

Similar issue from a guy on Reddit, https://www.reddit.com/r/klippers/comments/16u2jt9/cant_connect_to_moonraker_ip_on_mac_but_can_on/?utm_source=share&utm_medium=web2x&context=3

What did you expect to happen instead?

It should work on MacOS Sonoma

How to reproduce this bug?

Open the .local DNS for example mine is ratos.local in any browser using MacOS Sonoma.

Additional information:

@SpaghettiC0des SpaghettiC0des added the ⚡ Type: Bug Something isn't working label Oct 30, 2023
@meteyou
Copy link
Member

meteyou commented Oct 30, 2023

Which port do you use to connect to your printer on my.mainsail.xyz?

@SpaghettiC0des
Copy link
Author

SpaghettiC0des commented Oct 30, 2023 via email

@meteyou
Copy link
Member

meteyou commented Oct 30, 2023

What happen, if you use port 80?

@SpaghettiC0des
Copy link
Author

SpaghettiC0des commented Oct 30, 2023 via email

@meteyou
Copy link
Member

meteyou commented Oct 30, 2023

Pls upload you moonraker.log and your nginx config.

@meteyou
Copy link
Member

meteyou commented Oct 30, 2023

i double-checked your conversation with arksine in the moonraker repo. i also tested today all my mac devices and i cannot find any issue.

my mac mini is running 13.5.1 -> without issues
macbook air was running 14.0 -> without issues
macbook air updated to 14.1 -> without issues

i tested on every os version safari + chrome

@Arksine
Copy link

Arksine commented Oct 30, 2023

Meteyou informed me in the Moonraker issue that Fluidd connects to port 7125 by default. Given this, it sounds like its an issue with nginx.

In addition to the log files requested by meteyou, I would recommend double checking to see if mainsail-access.log and mainsail-error.log are not available. The error log in particular may provide relevant information.

image

If they aren't there then we should be able to get them via scp. I'm not familiar with MacOS but I presume it is very similar to linux.

In a future version of MainsailOS it might be worthwhile to provide a symbolic link to the nginx configuration in the ~/printer_data/config . We wouldn't be able to modify it, but we should be able to read it and therefore download it.

@meteyou
Copy link
Member

meteyou commented Oct 31, 2023

@Arksine we have now another user on our discord server with the same issue. He only create a new user on the identical Mac and it works with the new user. So it's an issue with one specific MacOS version with some user settings, but we don't know which...

@SpaghettiC0des
Copy link
Author

@meteyou I'm using the latest MacOS Sonoma. My M1 Mac is not working; my 2016 Intel MacBook was able to access the printer's local DNS but is using an old MacOS version.

@meteyou
Copy link
Member

meteyou commented Oct 31, 2023

@SpaghettiC0des i tested it yesterday with my MacBook air M1 with the newest updates and I can't reproduce this issue.

@SpaghettiC0des
Copy link
Author

@meteyou, thanks for checking! I have only one app installed that modifies the network settings, freedom.to. But I don't think it's causing the issue because I turn it off when using the printer.

Local DNS' port 80 seems to be the only port affected by this issue.

@SpaghettiC0des
Copy link
Author

mainsail-access.log

@Arksine @meteyou, here are the mainsail-access logs, the error log is empty, so I will not include it here.

@meteyou
Copy link
Member

meteyou commented Dec 8, 2023

I cannot reproduce this issue and there are also no other users with this bug. So it look like an issue with your specific setup. I will reopen this post, if there are more users with this bug and it is possible to reproduce it.

@meteyou meteyou closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2023
@3DCoded
Copy link

3DCoded commented Feb 26, 2024

I have this same issue, even after reinstalling MacOS. Please fix this, as I have been forced to switch to Fluidd, though I prefer Mainsail. The weird issue is that Mainsail did work before, but suddenly stopped working one day. 🤷‍♂️

@SpaghettiC0des
Copy link
Author

@3DCoded @meteyou

I found the issue and found a solution.

The issue is that the Raspberry Pi's OS(Ubuntu) datetime, which is out of sync and it is causing some issues with the SSL(?).

Try running sudo ntpdate pool.ntp.org; if you encounter a ntpdate command not found error, you must install it first.

@meteyou
Copy link
Member

meteyou commented Mar 31, 2024

the system time, should only be important with SSL/https. But you have to keep in mind, when you connect from https://my.mainsail.xyz you have also to use moonraker with SSL, because your browser only allow to connect from a SSL website to a SSL secure websocket.

@3DCoded
Copy link

3DCoded commented Apr 1, 2024

@3DCoded @meteyou

I found the issue and found a solution.

The issue is that the Raspberry Pi's OS(Ubuntu) datetime, which is out of sync and it is causing some issues with the SSL(?).

Try running sudo ntpdate pool.ntp.org; if you encounter a ntpdate command not found error, you must install it first.

@SpaghettiC0des
I tried your solution and I am still unable to get Mainsail to work with my Mac. When I run the command, I get the following output:
2024-04-01 15:52:45.229046 (-0400) +0.497748 +/- 0.510828 pool.ntp.org 23.157.160.168 s2 no-leap
However, after running it a couple more times, I get this output:
2024-04-01 15:52:57.241842 (-0400) +1.014783 +/- 1.031116 pool.ntp.org 23.157.160.168 s2 no-leap CLOCK: time stepped by 1.014783
and then:
2024-04-01 15:52:59.998458 (-0400) -1.022499 +/- 0.008533 pool.ntp.org 23.157.160.168 s2 no-leap CLOCK: time stepped by -1.022499

Any help would be appreciated.

@meteyou
Copy link
Member

meteyou commented Apr 2, 2024

@3DCoded do you use SSL to connect to mainsail?

@3DCoded
Copy link

3DCoded commented Apr 3, 2024

I don't think I use SSL to connect to Mainsail. I just used the default install from KIAUH.

@meteyou
Copy link
Member

meteyou commented Apr 4, 2024

I think the system time is only important for SSL, so this should not be a problem in your case.

@jpwolfe9912
Copy link

@SpaghettiC0des Did you ever figure this out? I'm having the same issue on Mac

@3DCoded
Copy link

3DCoded commented Aug 11, 2024

I ended up wiping my Pi several times and reinstalling my VPN to make it work.

@meteyou
Copy link
Member

meteyou commented Aug 11, 2024

@3DCoded to be honest. It is no issue with the Pi. its just a MacOS/Safari issue. so wiping the pi will not fix this issue...

@jpwolfe9912
Copy link

I've had other weird network issues on my Mac where it just won't connect to certain websites or servers that my phone or PC have no problem with. Is there some way to hard reset a Mac's network settings? I couldn't find anything good online

@meteyou
Copy link
Member

meteyou commented Aug 11, 2024

@jpwolfe9912 if this would be a generic "mac network issue", then we would also have issues with other browsers, but this issue only exists with Safari (and maybe only in one single version of it)

@3DCoded
Copy link

3DCoded commented Aug 11, 2024

@3DCoded to be honest. It is no issue with the Pi. its just a MacOS/Safari issue. so wiping the pi will not fix this issue...

I'm not exactly sure why wiping the Pi fixed it. My installation of Mainsail may have been corrupted. For some reason, it still only loads now if I install Fluidd on port 80, and Mainsail on Port 81. This also happens with Chrome.

@meteyou
Copy link
Member

meteyou commented Aug 11, 2024

@3DCoded then you have a different issue. This issue here is only a Safari issue.

@jpwolfe9912
Copy link

Part of the issue might be with the Pi but I think it's mostly the Mac. Doesn't work on any browser. Weirdly enough, if I use my Windows VM on my Mac, it works fine... isn't that weird.

@meteyou
Copy link
Member

meteyou commented Aug 12, 2024

@jpwolfe9912 then it is a different issue then this issue here. Feel free to open a post in the support-forum on our discord or here in the discussions section.

This issue here is only for the issue between safari on Mac and your host.

@meteyou
Copy link
Member

meteyou commented Aug 17, 2024

we found a possible reason for this issue. pls check the post in the "new" issue and pls give some feedback: #1774 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡ Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants