-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Fix if spoolman spool is missing #791
Conversation
Currently if the last selected spool gets deleted from the spoolman database, the spoolman component fails to load. This fix sets the selected spool to None if that happens so the component can load
Hi. A 404 returned by the proxy request would not cause a failure to load the Spoolman component. The front end is misreporting it as such because it believes that the proxy endpoint doesn't exist due to the 404, when its Spoolman is returning 404. While this is understandable, I think that frontends need to treat errors as if they were returned by Spoolman when using this endpoint. Moonraker reports a list of loaded components and failed components in its I don't think its a good idea to change the active spool in the proxy endpoint. The message string isn't a reliable source for comparison, if the error response changes just one character we will always evaluate to False. In addition, having Moonraker return the message in place of a 404 error represents an API change that some clients may not be able to deal with. There may be some things we can do better to help alleviate this issue, but regardless of what we do changes will need to be made at the frontend to accommodate it. |
Fair enough, it was just a initial draft, I'm open to new ideas Might also be a good idea to talk to the guy from spoolman and maybe add a specifiy error code for spool not found? |
I just opened #792 with the aim of resolving this issue. I makes some changes that should reduce the chance that Moonraker's spool id does not exist in the Spoolman Database. In addition it makes an API change that will allow frontends to deal with the ambiguous 404 error, however it will require implementation on their side.
Based on the behavior described, I'm reasonably certain that the component hasn't actually failed. The ambiguous 404 returned when a spool doesn't exist translates to
In this case 404 is the right code to return. I think correcting this issue in Moonraker and the frontends is the appropriate solution. |
Problem is that moonraker can't control whether the spool gets deleted. Concerning the mainsail reads error wrong, I'll try to come up with a patch for that and do a pr on mainsail, I just figured it would be a moonraker error, since I got a moonraker warning(which is actually mainsail, which is confusing XD) And concerning the error code: I am not that much of a web dev and not that much into error codes, so my bad I guess :) |
This should now be resolved on Moonraker's side. The major known frontends have changes complete or in process. |
Currently if the last selected spool gets deleted from the spoolman database, the spoolman component fails to load. This fix sets the selected spool to None if that happens so the component can load