OllisGit / OctoPrint-SpoolManager

Plugin for managing Spools
169 stars 57 forks source link

Cannot enable the plugin after installation #254

Closed WoutV closed 2 years ago

WoutV commented 2 years ago

I am using octoprint running in docker. When I install the plugin and enable it, restarting the container just disables the plugin again. Relevant log part below:


2022-03-31 10:12:02,576 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 1.1.1.1:53 is working
2022-03-31 10:12:02,577 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is working
2022-03-31 10:12:02,646 - octoprint.startup - INFO - Blacklist processing done, adding 3 blacklisted plugin versions: roomtemp (any), GcodeEditor (>=0.1.1,<=0.2.8), gcodeleveling (>=0.1.0,<=0.1.1)
2022-03-31 10:12:02,721 - octoprint.plugin.core - INFO - Loading plugins from /usr/local/lib/python3.8/site-packages/octoprint/plugins, /octoprint/octoprint/plugins and installed plugin packages...
2022-03-31 10:12:05,617 - octoprint.plugin.core - INFO - Plugin Pi Support Plugin (2021.10.28) did not pass check, not loading.
2022-03-31 10:12:05,765 - octoprint.plugin.core - INFO - Found 21 plugin(s) providing 21 mixin implementations, 47 hook handlers
2022-03-31 10:12:05,930 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2022-03-31 10:12:06,065 - octoprint.server - INFO - Intermediary server started
2022-03-31 10:12:06,139 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /octoprint/octoprint/uploads...
2022-03-31 10:12:06,247 - octoprint.filemanager.storage - INFO - ... file metadata for /octoprint/octoprint/uploads initialized successfully.
2022-03-31 10:12:06,268 - octoprint.server - INFO - Added new permission from plugin action_command_notification: PLUGIN_ACTION_COMMAND_NOTIFICATION_SHOW (needs: "Need(method='role', value='plugin_action_command_notification_show')")
2022-03-31 10:12:06,269 - octoprint.server - INFO - Added new permission from plugin action_command_notification: PLUGIN_ACTION_COMMAND_NOTIFICATION_CLEAR (needs: "Need(method='role', value='plugin_action_command_notification_clear')")
2022-03-31 10:12:06,269 - octoprint.server - INFO - Added new permission from plugin action_command_prompt: PLUGIN_ACTION_COMMAND_PROMPT_INTERACT (needs: "Need(method='role', value='plugin_action_command_prompt_interact')")
2022-03-31 10:12:06,270 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_READ (needs: "Need(method='role', value='plugin_announcements_read')")
2022-03-31 10:12:06,270 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_MANAGE (needs: "Need(method='role', value='plugin_announcements_manage'), Need(method='role', value='plugin_announcements_read')")
2022-03-31 10:12:06,271 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_ADMIN (needs: "Need(method='role', value='plugin_appkeys_admin')")
2022-03-31 10:12:06,271 - octoprint.server - INFO - Added new permission from plugin backup: PLUGIN_BACKUP_ACCESS (needs: "Need(method='role', value='plugin_backup_access')")
2022-03-31 10:12:06,272 - octoprint.server - INFO - Added new permission from plugin firmware_check: PLUGIN_FIRMWARE_CHECK_DISPLAY (needs: "Need(method='role', value='plugin_firmware_check_display')")
2022-03-31 10:12:06,272 - octoprint.server - INFO - Added new permission from plugin logging: PLUGIN_LOGGING_MANAGE (needs: "Need(method='role', value='plugin_logging_manage')")
2022-03-31 10:12:06,273 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_MANAGE (needs: "Need(method='role', value='plugin_pluginmanager_manage')")
2022-03-31 10:12:06,273 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_INSTALL (needs: "Need(method='role', value='plugin_pluginmanager_install'), Need(method='role', value='plugin_pluginmanager_manage')")
2022-03-31 10:12:06,275 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CHECK (needs: "Need(method='role', value='plugin_softwareupdate_check')")
2022-03-31 10:12:06,282 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_UPDATE (needs: "Need(method='role', value='plugin_softwareupdate_update')")
2022-03-31 10:12:06,284 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CONFIGURE (needs: "Need(method='role', value='plugin_softwareupdate_configure')")
2022-03-31 10:12:06,336 - octoprint.printer.standard - INFO - Using print time estimator provided by PrintTimeGenius
2022-03-31 10:12:06,603 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
2022-03-31 10:12:07,746 - octoprint.util.pip - INFO - Using "/usr/local/bin/python -m pip" as command to invoke pip
2022-03-31 10:12:08,861 - octoprint.util.pip - INFO - Version of pip is 21.2.4
2022-03-31 10:12:08,863 - octoprint.util.pip - INFO - pip installs to /usr/local/lib/python3.8/site-packages (writable -> yes), --user flag needed -> no, virtual env -> no
2022-03-31 10:12:08,864 - octoprint.util.pip - INFO - ==> pip ok -> yes
2022-03-31 10:12:08,905 - octoprint.plugins.SpoolManager - INFO - Start initializing
2022-03-31 10:12:08,908 - octoprint.plugins.SpoolManager.DatabaseManager - INFO - Init DatabaseManager
2022-03-31 10:12:08,912 - octoprint.plugins.SpoolManager.DatabaseManager - INFO - Databasefile '/octoprint/octoprint/data/SpoolManager/spoolmanager.db' exists: True
2022-03-31 10:12:08,925 - octoprint.plugins.SpoolManager.DatabaseManager - INFO - Check if database-scheme upgrade needed...
2022-03-31 10:12:08,932 - octoprint.plugins.SpoolManager.DatabaseManager - ERROR - no such table: spo_pluginmetadatamodel
Traceback (most recent call last):
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.OperationalError: no such table: spo_pluginmetadatamodel

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/octoprint/plugins/lib/python3.8/site-packages/octoprint_SpoolManager/DatabaseManager.py", line 114, in _createOrUpgradeSchemeIfNecessary
    cursor = self.db.execute_sql('select "value" from "spo_pluginmetadatamodel" where key="'+PluginMetaDataModel.KEY_DATABASE_SCHEME_VERSION+'";')
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3184, in execute_sql
    self.commit()
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 2950, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 191, in reraise
    raise value.with_traceback(tb)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
peewee.OperationalError: no such table: spo_pluginmetadatamodel
2022-03-31 10:12:08,937 - octoprint.plugins.SpoolManager.DatabaseManager - INFO - Creating new database tables for spoolmanager-plugin
2022-03-31 10:12:14,019 - octoprint.plugin.core - ERROR - Exception while initializing plugin SpoolManager, disabling it
Traceback (most recent call last):
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.OperationalError: no such table: spo_pluginmetadatamodel

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/octoprint/plugins/lib/python3.8/site-packages/octoprint_SpoolManager/DatabaseManager.py", line 114, in _createOrUpgradeSchemeIfNecessary
    cursor = self.db.execute_sql('select "value" from "spo_pluginmetadatamodel" where key="'+PluginMetaDataModel.KEY_DATABASE_SCHEME_VERSION+'";')
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3184, in execute_sql
    self.commit()
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 2950, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 191, in reraise
    raise value.with_traceback(tb)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
peewee.OperationalError: no such table: spo_pluginmetadatamodel

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.OperationalError: database is locked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/octoprint/plugin/core.py", line 1984, in initialize_implementation
    implementation.initialize()
  File "/usr/local/lib/python3.8/site-packages/octoprint/util/__init__.py", line 1737, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/octoprint/util/__init__.py", line 1737, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/octoprint/util/__init__.py", line 1737, in wrapper
    return f(*args, **kwargs)
  [Previous line repeated 5 more times]
  File "/octoprint/plugins/lib/python3.8/site-packages/octoprint_SpoolManager/__init__.py", line 44, in initialize
    self._databaseManager.initDatabase(databaseSettings, self._sendMessageToClient)
  File "/octoprint/plugins/lib/python3.8/site-packages/octoprint_SpoolManager/DatabaseManager.py", line 620, in initDatabase
    self._createDatabase(FORCE_CREATE_TABLES)
  File "/octoprint/plugins/lib/python3.8/site-packages/octoprint_SpoolManager/DatabaseManager.py", line 104, in _createDatabase
    self._createOrUpgradeSchemeIfNecessary()
  File "/octoprint/plugins/lib/python3.8/site-packages/octoprint_SpoolManager/DatabaseManager.py", line 137, in _createOrUpgradeSchemeIfNecessary
    self._createDatabaseTables()
  File "/octoprint/plugins/lib/python3.8/site-packages/octoprint_SpoolManager/DatabaseManager.py", line 571, in _createDatabaseTables
    self._database.create_tables(MODELS)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3369, in create_tables
    model.create_table(**options)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 6758, in create_table
    cls._schema.create_all(safe, **options)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 5861, in create_all
    self.create_table(safe, **table_options)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 5716, in create_table
    self.database.execute(self._create_table(safe=safe, **options))
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3190, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3184, in execute_sql
    self.commit()
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 2950, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 191, in reraise
    raise value.with_traceback(tb)
  File "/octoprint/plugins/lib/python3.8/site-packages/peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
peewee.OperationalError: database is locked```
WoutV commented 2 years ago

Turns out I don't know how docker handles permissions on volumes shared through a NAS. Working directly from the Pi SD card turned out fine.