OllisGit / OctoPrint-SpoolManager

Plugin for managing Spools
169 stars 59 forks source link

Entire spool database deleted/corrupted after adding new spool #347

Closed gbeatty closed 6 months ago

gbeatty commented 6 months ago

When I added 2 new spools today, the entire spool database was deleted/corrupted.

Order of events: Completed a print - selected spool (Elegoo - Black) was detected as empty (-5g) even though it had a small amount of filament left Octoprint still had the previous print selected for pending print with Elegoo - Black set as the active spool when I did the following steps. Copy spool Elegoo - Black Edit copy for new spool and save Delete Elegoo - Black Copy spool Elegoo - White Edit copy for another new spool and save After save, every single spool appears to be deleted and I'm unable to add any new spools

gbeatty commented 6 months ago

Log file starting with the copy of the first spool:

2024-01-08 08:25:30,330 - octoprint.plugins.dashboard - INFO - GcodePreProcessor started processing. 2024-01-08 08:26:31,936 - octoprint.filemanager.analysis - INFO - Starting analysis of local:gearbox_layer1and2_0.3mm_PLA_MK3_9h19m.gcode 2024-01-08 08:26:35,055 - octoprint.plugins.SpoolManager - INFO - API generate QR code for Spool with databaseId: 13 2024-01-08 08:26:35,938 - octoprint.plugins.SpoolManager - INFO - Send Event 'plugin_spoolmanager_spool_selected' with payload '{'toolId': 0, 'databaseId': 13, 'spoolName': 'Elegoo - Black', 'material': 'PLA', 'colorName': 'black', 'remainingWeight': -5.902781460443407}' to event-bus 2024-01-08 08:26:35,951 - octoprint.plugins.SpoolManager - INFO - tool0, requiredWeight '138.75072098890934', remainingWeight '-5.902781460443407' 2024-01-08 08:26:35,951 - octoprint.plugins.SpoolManager - INFO - Filament not enough! 2024-01-08 08:26:35,952 - octoprint.plugins.SpoolManager - WARNING - SendToClient: warning#Filament not enough!#Required on tool 0: 138g, available from Spool 'Elegoo - Black': '-5g' 2024-01-08 08:26:35,989 - octoprint.plugins.dashboard - INFO - GcodePreProcessor found layers: 117 2024-01-08 08:26:35,990 - octoprint.plugins.dashboard - INFO - GcodePreProcessor found filament changes: 0 2024-01-08 08:26:35,990 - octoprint.plugins.dashboard - INFO - GcodePreProcessor saving layer count in file metadata 2024-01-08 08:26:47,850 - octoprint.server.heartbeat - INFO - Server heartbeat <3 2024-01-08 08:27:02,789 - octoprint.plugins.SpoolManager - INFO - API Save spool 2024-01-08 08:27:02,792 - octoprint.plugins.SpoolManager - INFO - Create new spool 2024-01-08 08:27:02,864 - octoprint.plugins.SpoolManager - INFO - Send Event 'plugin_spoolmanager_spool_added' with payload '{'databaseId': 14, 'spoolName': 'Kingroon - Black', 'material': 'PLA', 'colorName': 'black', 'remainingWeight': 1000.0}' to event-bus 2024-01-08 08:27:02,885 - octoprint.plugins.SpoolManager - INFO - Send Event 'plugin_spoolmanager_spool_selected' with payload '{'toolId': 0, 'databaseId': 13, 'spoolName': 'Elegoo - Black', 'material': 'PLA', 'colorName': 'black', 'remainingWeight': -5.902781460443407}' to event-bus 2024-01-08 08:27:02,895 - octoprint.plugins.SpoolManager - INFO - tool0, requiredWeight '138.75072098890934', remainingWeight '-5.902781460443407' 2024-01-08 08:27:02,895 - octoprint.plugins.SpoolManager - INFO - Filament not enough! 2024-01-08 08:27:02,895 - octoprint.plugins.SpoolManager - WARNING - SendToClient: warning#Filament not enough!#Required on tool 0: 138g, available from Spool 'Elegoo - Black': '-5g' 2024-01-08 08:27:03,020 - octoprint.plugins.SpoolManager - INFO - Send Event 'plugin_spoolmanager_spool_selected' with payload '{'toolId': 0, 'databaseId': 13, 'spoolName': 'Elegoo - Black', 'material': 'PLA', 'colorName': 'black', 'remainingWeight': -5.902781460443407}' to event-bus 2024-01-08 08:27:03,137 - octoprint.plugins.SpoolManager - INFO - Send Event 'plugin_spoolmanager_spool_selected' with payload '{'toolId': 0, 'databaseId': 13, 'spoolName': 'Elegoo - Black', 'material': 'PLA', 'colorName': 'black', 'remainingWeight': -5.902781460443407}' to event-bus 2024-01-08 08:27:05,422 - octoprint.plugins.SpoolManager - INFO - API generate QR code for Spool with databaseId: 13 2024-01-08 08:27:08,112 - octoprint.plugins.SpoolManager - INFO - API Delete spool with database id '13' 2024-01-08 08:27:08,528 - octoprint.plugins.SpoolManager - INFO - Send Event 'plugin_spoolmanager_spool_deleted' with payload '{'databaseId': 13}' to event-bus 2024-01-08 08:27:08,653 - octoprint - ERROR - Exception on /plugin/SpoolManager/loadSpoolsByQuery [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(*args, *kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 914, in loadAllSpoolsByQuery for selectedSpool in self.loadSelectedSpools() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 143, in loadSelectedSpools "Last selected Spool for Tool %d from plugin-settings not found in database. Maybe deleted in the meantime." % i) NameError: name 'i' is not defined 2024-01-08 08:27:08,781 - octoprint - ERROR - Exception on /plugin/SpoolManager/loadSpoolsByQuery [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(*args, *kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 914, in loadAllSpoolsByQuery for selectedSpool in self.loadSelectedSpools() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 143, in loadSelectedSpools "Last selected Spool for Tool %d from plugin-settings not found in database. Maybe deleted in the meantime." % i) NameError: name 'i' is not defined 2024-01-08 08:27:08,822 - octoprint.plugins.dashboard - ERROR - Frontend javascript error detected (this error is not necesarily to do with dashboard): Message: Uncaught TypeError: Cannot read properties of undefined (reading 'materials') - URL: http://octopi.local/static/webassets/packed_plugins.js?ea552334 - Line: 9918 - Column: 56 - Error object: {} 2024-01-08 08:27:08,822 - octoprint.JsFrontendErrors(Dash) - ERROR - Message: Uncaught TypeError: Cannot read properties of undefined (reading 'materials') - URL: http://octopi.local/static/webassets/packed_plugins.js?ea552334 - Line: 9918 - Column: 56 - Error object: {} 2024-01-08 08:27:11,724 - octoprint.plugins.SpoolManager - INFO - API generate QR code for Spool with databaseId: 2 2024-01-08 08:27:16,301 - octoprint.filemanager.analysis - INFO - Analysis of entry local:gearbox_layer1and2_0.3mm_PLA_MK3_9h19m.gcode finished, needed 44.36s 2024-01-08 08:27:34,531 - octoprint.plugins.SpoolManager - INFO - API Save spool 2024-01-08 08:27:34,536 - octoprint.plugins.SpoolManager - INFO - Create new spool 2024-01-08 08:27:34,610 - octoprint.plugins.SpoolManager - INFO - Send Event 'plugin_spoolmanager_spool_added' with payload '{'databaseId': 15, 'spoolName': 'Kingroon - White', 'material': 'PLA', 'colorName': 'white', 'remainingWeight': 1000.0}' to event-bus 2024-01-08 08:27:34,645 - octoprint - ERROR - Exception on /plugin/SpoolManager/saveSpool [PUT] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(*args, *kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 988, in saveSpool self.checkRemainingFilament() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/init.py", line 81, in checkRemainingFilament selectedSpools = self.loadSelectedSpools() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 143, in loadSelectedSpools "Last selected Spool for Tool %d from plugin-settings not found in database. Maybe deleted in the meantime." % i) NameError: name 'i' is not defined 2024-01-08 08:27:34,785 - octoprint - ERROR - Exception on /plugin/SpoolManager/loadSpoolsByQuery [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(*args, *kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 914, in loadAllSpoolsByQuery for selectedSpool in self.loadSelectedSpools() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 143, in loadSelectedSpools "Last selected Spool for Tool %d from plugin-settings not found in database. Maybe deleted in the meantime." % i) NameError: name 'i' is not defined 2024-01-08 08:27:34,886 - octoprint - ERROR - Exception on /plugin/SpoolManager/loadSpoolsByQuery [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(*args, *kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 914, in loadAllSpoolsByQuery for selectedSpool in self.loadSelectedSpools() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 143, in loadSelectedSpools "Last selected Spool for Tool %d from plugin-settings not found in database. Maybe deleted in the meantime." % i) NameError: name 'i' is not defined 2024-01-08 08:27:40,919 - octoprint.plugins.SpoolManager - INFO - API generate QR code for Spool with databaseId: 2 2024-01-08 08:27:43,229 - octoprint.plugins.SpoolManager - INFO - API Delete spool with database id '2' 2024-01-08 08:27:43,288 - octoprint.plugins.SpoolManager - INFO - Send Event 'plugin_spoolmanager_spool_deleted' with payload '{'databaseId': 2}' to event-bus 2024-01-08 08:27:43,426 - octoprint - ERROR - Exception on /plugin/SpoolManager/loadSpoolsByQuery [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(*args, *kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 914, in loadAllSpoolsByQuery for selectedSpool in self.loadSelectedSpools() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 143, in loadSelectedSpools "Last selected Spool for Tool %d from plugin-settings not found in database. Maybe deleted in the meantime." % i) NameError: name 'i' is not defined 2024-01-08 08:27:43,526 - octoprint - ERROR - Exception on /plugin/SpoolManager/loadSpoolsByQuery [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(*args, *kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 914, in loadAllSpoolsByQuery for selectedSpool in self.loadSelectedSpools() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 143, in loadSelectedSpools "Last selected Spool for Tool %d from plugin-settings not found in database. Maybe deleted in the meantime." % i) NameError: name 'i' is not defined 2024-01-08 08:27:45,764 - octoprint.server.util.flask - INFO - Passively logging in user darknight201 from ::ffff:192.168.4.28 2024-01-08 08:27:45,764 - octoprint.access.users - INFO - Logged in user: darknight201 2024-01-08 08:27:46,064 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:192.168.4.28 2024-01-08 08:27:47,259 - octoprint - ERROR - Exception on /plugin/SpoolManager/loadSpoolsByQuery [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(*args, *kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 914, in loadAllSpoolsByQuery for selectedSpool in self.loadSelectedSpools() File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_SpoolManager/api/SpoolManagerAPI.py", line 143, in loadSelectedSpools "Last selected Spool for Tool %d from plugin-settings not found in database. Maybe deleted in the meantime." % i) NameError: name 'i' is not defined 2024-01-08 08:27:47,423 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.4.28 2024-01-08 08:27:47,439 - octoprint.plugins.PrintJobHistory - INFO - Plugin-State: | PreHeat=missing (None) | filamentmanager=missing (None) | DisplayLayerProgress=missing (None) | SpoolManager=enabled (1.7.3) | UltimakerFormat=enabled (1.0.2) | PrusaSlicerThumbnail=enabled (1.0.3) | costestimation=enabled (3.5.0)

gbeatty commented 6 months ago

Closing this issue. This fork is dead/abandoned and the new official version is https://github.com/dojohnso/OctoPrint-SpoolManager