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

Regularly stuck at "Initializing..." using web UI #282

Open
esb7 opened this issue Jan 27, 2024 · 3 comments
Open

Regularly stuck at "Initializing..." using web UI #282

esb7 opened this issue Jan 27, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@esb7
Copy link

esb7 commented Jan 27, 2024

What happened

I regularly get stuck at "Initializing..." when accessing mainsail from a web browser on my Mac. Sometimes it works and other times it fails and will continue to fail even through reboots of the rPi hosting mainsail. It would occur on different web browsers as well.

What did you expect to happen

Web UI should be consistent and responsive, not hung.

How to reproduce

Use mainsailos.local to access the printer web UI.

Additional information

The issue seems caused by "unauthorized" errors that show up in the moonraker log:

2024-01-20 18:50:33,939 [websockets.py:on_close()] - Websocket Closed: ID: 2822839248 Close Code: 1001, Close Reason: None, Pong Time Elapsed: 8.53 2024-01-20 18:50:34,137 [websockets.py:prepare()] - Websocket Failed Authentication: HTTP 401: Unauthorized (Unauthorized) 2024-01-20 18:50:34,140 [app.py:log_request()] - 101 GET /websocket (fd70:616c:c5db:914e:18f6:e20b:5620:9152) [No User] 23.93ms

I noticed that the failed authentications all had a reported ipv6 address and on further investigation were all in a range outside of the allowed range in the trusted_clients: section in moonraker.conf. The primary / default trusted ipv6 range is FE80::/10. However that appear to exclude other local-only address ranges (including the FD70 my device had). I believe the default should be: FC00::/7.

For anybody that hits this, you can get past it by adding the following to the trusted clients: section of the moonraker.conf file:

[authorization]
...
trusted_clients:
...
    FC00::/7        <------------- add this
...```
@esb7 esb7 added the bug Something isn't working label Jan 27, 2024
@meteyou
Copy link
Member

meteyou commented Jan 27, 2024

FE80::/10 is reservated for local ip addresses in the ipv6 network. if you network use a different network, you have to add it. you can read more informations about FE80::/10 for example here: https://en.wikipedia.org/wiki/IPv6#Link-local_address

@meteyou meteyou closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2024
@esb7
Copy link
Author

esb7 commented Jan 27, 2024

From what I can tell, there is a larger "Unique Local Address" range defined for IPv6 that is subtly different than link local, but is equivalent to the non-publicly routable 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 ranges in IPv4:

https://en.wikipedia.org/wiki/Unique_local_address

My local network (using UniFi network gear) appears to be set up by default to allocate IPv6 addresses in the larger FC00::/7 range (outside of the link-local range). As a result, I get the above "Initializing..." hang / "unauthorized" errors.

It seems like it should be universally safe to include the larger "Unique Local" range by default.

@meteyou
Copy link
Member

meteyou commented Jan 27, 2024

Ah ok. I didn't know that. I will double check it in the team and maybe we will add it.

@meteyou meteyou reopened this Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants