The log lines look like:
2018-09-25 17:38:42,944 - plugin.tasks_approved - DEBUG - Skipping: inactive
And are often repeated over and over.
This error is reported for a few different reasons. Let’s go through them:
If an event matches a script conditions in your plugins directory, but the script/plugin is inactive and so it is not processed. Plugins can become inactive by either removing them from the plugin directory or deleting them altogether:
eId = None
for plugin in self:
if not plugin.isActive():
continue
newId = plugin.getNextUnprocessedEventId()
if newId is not None and (eId is None or newId < eId):
eId = newId
return eId
def process(self, event):
for plugin in self:
if plugin.isActive():
plugin.process(event)
else:
plugin.logger.debug('Skipping: inactive.')
def load(self):
"""
Load plugins from disk.
The plugin will also become inactive if an error is raised whilst loading the plugin due to an issue in the code:
return
# Reset values
self._mtime = mtime
self._callbacks = []
self._active = True
try:
plugin = imp.load_source(self._pluginName, self._path)
except:
self._active = False
self.logger.error('Could not load the plugin at %s.\n\n%s', self._path, traceback.format_exc())
return
regFunc = getattr(plugin, 'registerCallbacks', None)
if callable(regFunc):
try:
regFunc(Registrar(self))
except:
self._engine.log.critical('Error running register callback function from plugin at %s.\n\n%s', self._path, traceback.format_exc())
self._active = False
If it fails to register:
self._active = False
self.logger.error('Could not load the plugin at %s.\n\n%s', self._path, traceback.format_exc())
return
regFunc = getattr(plugin, 'registerCallbacks', None)
if callable(regFunc):
try:
regFunc(Registrar(self))
except:
self._engine.log.critical('Error running register callback function from plugin at %s.\n\n%s', self._path, traceback.format_exc())
self._active = False
else:
self._engine.log.critical('Did not find a registerCallbacks function in plugin at %s.', self._path)
self._active = False
def registerCallback(self, sgScriptName, sgScriptKey, callback, matchEvents=None, args=None, stopOnError=True):
"""
Register a callback in the plugin.
"""
global sg
sgConnection = sg.Shotgun(self._engine.config.getShotgunURL(), sgScriptName, sgScriptKey,
Or if there is a plugin with no registering method found:
regFunc = getattr(plugin, 'registerCallbacks', None)
if callable(regFunc):
try:
regFunc(Registrar(self))
except:
self._engine.log.critical('Error running register callback function from plugin at %s.\n\n%s', self._path, traceback.format_exc())
self._active = False
else:
self._engine.log.critical('Did not find a registerCallbacks function in plugin at %s.', self._path)
self._active = False
def registerCallback(self, sgScriptName, sgScriptKey, callback, matchEvents=None, args=None, stopOnError=True):
"""
Register a callback in the plugin.
"""
global sg
sgConnection = sg.Shotgun(self._engine.config.getShotgunURL(), sgScriptName, sgScriptKey,
http_proxy=self._engine.config.getEngineProxyServer())
self._callbacks.append(Callback(callback, self, self._engine, sgConnection, matchEvents, args, stopOnError))
Hi!
How does the deamon supposed to recover from inactive state.
Say, it encounters an error (eg. can’t do an ssh connection temporarily) that resolves itself in time.
The plugin became inactive. What does make the plugin active again? Or do I have to restart it manually?
Thanks in advance!