Donkie / Spoolman

Keep track of your inventory of 3D-printer filament spools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

403 Error in Docker when try to connect with Moonraker

gfosdike1 opened this issue · comments

Describe the bug
You see the following in the logs in docker when Moonraker tries to connect:
2024-02-15 15:49:20 spoolman-1 | INFO: ('172.18.0.1', 39668) - "WebSocket /spool" 403
2024-02-15 15:49:20 spoolman-1 | INFO: connection failed (403 Forbidden)
2024-02-15 15:49:20 spoolman-1 | INFO: connection closed
2024-02-15 15:49:20 spoolman-1 | INFO: ('172.18.0.1', 39674) - "WebSocket /spool" 403
2024-02-15 15:49:20 spoolman-1 | INFO: connection failed (403 Forbidden)
2024-02-15 15:49:20 spoolman-1 | INFO: connection closed
2024-02-15 15:49:20 spoolman-1 | INFO: ('172.18.0.1', 39682) - "WebSocket /spool" 403
2024-02-15 15:49:20 spoolman-1 | INFO: connection failed (403 Forbidden)
2024-02-15 15:49:20 spoolman-1 | INFO: connection closed
2024-02-15 15:49:20 spoolman-1 | INFO: ('172.18.0.1', 39684) - "WebSocket /spool" 403
2024-02-15 15:49:20 spoolman-1 | INFO: connection failed (403 Forbidden)
2024-02-15 15:49:20 spoolman-1 | INFO: connection closed
2024-02-15 15:49:20 spoolman-1 | INFO: ('172.18.0.1', 39690) - "WebSocket /spool" 403
2024-02-15 15:49:20 spoolman-1 | INFO: connection failed (403 Forbidden)
2024-02-15 15:49:20 spoolman-1 | INFO: connection closed
2024-02-15 15:49:20 spoolman-1 | INFO: ('172.18.0.1', 39696) - "WebSocket /spool" 403
2024-02-15 15:49:20 spoolman-1 | INFO: connection failed (403 Forbidden)
2024-02-15 15:49:20 spoolman-1 | INFO: connection closed
2024-02-15 15:49:20 spoolman-1 | INFO: ('172.18.0.1', 39706) - "WebSocket /spool" 403
2024-02-15 15:49:20 spoolman-1 | INFO: connection failed (403 Forbidden)
2024-02-15 15:49:20 spoolman-1 | INFO: connection closed
2024-02-15 15:49:20 spoolman-1 | INFO: ('172.18.0.1', 39722) - "WebSocket /spool" 403

To Reproduce
Steps to reproduce the behaviour:
When you boot up the printer you seen an error in Mainsail and docker logs on remote pc.

Expected behaviour
Moonraker should be able to connect to Spoolman

Screenshots
image

Desktop (please complete the following information):

  • OS: Win 10
  • Browser Chrome
  • 121.0.6167.162

Additional context
The is what you see in the Moonraker Log:
(Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36, Host Name: 192.168.0.217
2024-02-14 23:15:05,023 [websockets.py:_handle_identify()] - Websocket 2825105936 Client Identified - Name: mainsail, Version: 2.9.1, Type: web
2024-02-14 23:15:05,052 [common.py:build_error()] - JSON-RPC Request Error - Requested Method: server.spoolman.proxy, Code: 503, Message: Spoolman server not available
2024-02-14 23:15:05,052 [common.py:build_error()] - JSON-RPC Request Error - Requested Method: server.spoolman.proxy, Code: 503, Message: Spoolman server not available
2024-02-14 23:15:05,075 [server.py:add_log_rollover_item()] - Failed to Connect to spoolman: HTTP 403: Forbidden
2024-02-14 23:15:05,089 [common.py:build_error()] - JSON-RPC Request Error - Requested Method: server.spoolman.proxy, Code: 503, Message: Spoolman server not available
2024-02-14 23:15:05,091 [common.py:build_error()] - JSON-RPC Request Error - Requested Method: server.spoolman.proxy, Code: 503, Message: Spoolman server not available
2024-02-14 23:15:07,110 [server.py:add_log_rollover_item()] - Failed to Connect to spoolman: HTTP 403: Forbidden
2024-02-14 23:15:09,140 [server.py:add_log_rollover_item()] - Failed to Connect to spoolman: HTTP 403: Forbidden
2024-02-14 23:15:11,170 [server.py:add_log_rollover_item()] - Failed to Connect to spoolman: HTTP 403: Forbidden
2024-02-14 23:15:13,197 [server.py:add_log_rollover_item()] - Failed to Connect to spoolman: HTTP 403: Forbidden

Looks like spoolman service is down based on 'Spoolman server not available'.
Can you include all of the spoolman container's log from the start?

FWIW, the 503 is Moonraker's error response to Mainsail. Moonraker is receiving a 403 Forbidden when attempting to connect to Spoolman's websocket on his instance. The persistent connection allows Moonraker to know when Spoolman is running and receive spool events so it knows if its currently set spool has been deleted.

I can't reproduce. To make sure it isn't occuring due to changes in Spoolman I pulled the latest and recreated in docker image.

2024-02-15 16:56:16:INFO:Starting Spoolman v0.16.1 (commit: babb95d) (built: 2024-02-04 10:12:19+00:00)
2024-02-15 16:56:16:INFO:Using data directory: /home/app/.local/share/spoolman
2024-02-15 16:56:16:INFO:Using logs directory: /home/app/.local/share/spoolman
2024-02-15 16:56:16:INFO:Using backups directory: /home/app/.local/share/spoolman/backups
2024-02-15 16:56:16:INFO:Setting up database...
2024-02-15 16:56:16:INFO:No database type specified, using a default SQLite database located at "/home/app/.local/share/spoolman/spoolman.db"
2024-02-15 16:56:16:INFO:Performing migrations...
2024-02-15 16:56:33:INFO:Scheduling automatic database backup for midnight.
2024-02-15 16:56:33:INFO:Startup complete.
2024-02-15 16:56:33:INFO:Client 10.0.0.10 is now listening on pool spool

The 10.0.0.10 client is one of my local Moonraker test machines.

Glad its working. You should close this issue now that its resolved. I have already closed the issue you created in Moonraker.