Spoolman slot mapping doesn't survive a restart (and multi-printer setups overwrite each other) #80
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The AMS-slot in Spoolman spool mapping doesn't stick. You set it, it works fine for that session, but after a restart it's gone. On a two-printer bridge it's worse: mapping one printer wipes out the other's. Digging in, there are two separate bugs.
Bug 1 - the mapping never actually gets saved or loaded (swallowed
NameError).Both the load (in
__init__) and the save (inhandle_kx_spoolman_set_active) callconfig_loader._find_config_file()â but the module is imported asenv_loaderup top (kobrax_moonraker_bridge.py:32), soconfig_loaderdoesn't exist in that scope. It throwsNameError, and the bareexceptaround it just swallows it. So nothing ever gets read back on startup or written on change; the mapping only lives in memory for the current session.Bug 2 - the map is global, so multi-printer setups overwrite each other.
Even with Bug 1 fixed, the mapping is kept in a single global
[spoolman] slot_spoolskey that every printer instance shares, so two AMS units end up stepping on each other. Same shape as the filament-profile problem from #74/#75.Steps to Reproduce
[spoolman] server=...and map a few AMS slots to spools from the UI.GET /kx/spoolman/status->slot_spoolscomes back empty.Expected Behavior
The mapping sticks across restarts, and each printer keeps its own.
Actual Behavior
It's dropped on every restart, and with two printers they clobber each other because they share one global key.
Environment
a16062f)Logs
Testing fixes ATM, waiting on a print to finish to validate persistance.
Will PR upon succesful test.
Both bugs confirmed and fixed in PR #83 by @walterioo — merged. Thank you for the thorough analysis and the ready-to-merge fix!
Fix will be live with the next nightly build.