You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the remote traceback: the _create_trigger method in the apscheduler failed.
========= Remote Traceback (1) =========
Traceback (most recent call last):
File "/home/linux/venv/mirrorit-qbPURi0Y/lib/python3.6/site-packages/rpyc/core/protocol.py", line 323, in _dispatch_request
res = self._HANDLERS[handler](self, *args)
File "/home/linux/venv/mirrorit-qbPURi0Y/lib/python3.6/site-packages/rpyc/core/protocol.py", line 585, in _handle_call
return obj(*args, **dict(kwargs))
File "/home/linux/Works/PyCharmProjects/mirrorit/mirrorit/scheduler.py", line 42, in exposed_add_job
return self.scheduler.add_job(*args, **kwargs)
File "/home/linux/venv/mirrorit-qbPURi0Y/lib/python3.6/site-packages/apscheduler/schedulers/base.py", line 420, in add_job
'trigger': self._create_trigger(trigger, trigger_args),
File "/home/linux/venv/mirrorit-qbPURi0Y/lib/python3.6/site-packages/apscheduler/schedulers/base.py", line 915, in _create_trigger
trigger.__class__.__name__)
TypeError: Expected a trigger instance or string, got ABCMeta instead
As we can see from the source code of _create_trigger, it determines whether the trigger is an instance of BaseTrigger. The _trigger variable created by CronTrigger.from_crontab(mirror.sync_time) is an instance of class CronTrigger(BaseTrigger), therefore it's indeed an instance of BaseTrigger. However, the server end resolved this argument to an instance of ABCMeta which cause the exception. Actually, BaseTrigger is a subclass of ABCMeta (class BaseTrigger(six.with_metaclass(ABCMeta))).
def_create_trigger(self, trigger, trigger_args):
ifisinstance(trigger, BaseTrigger):
returntriggereliftriggerisNone:
trigger='date'elifnotisinstance(trigger, six.string_types):
raiseTypeError('Expected a trigger instance or string, got %s instead'%trigger.__class__.__name__)
# Use the scheduler's time zone if nothing else is specifiedtrigger_args.setdefault('timezone', self.timezone)
# Instantiate the trigger classreturnself._create_plugin_instance('trigger', trigger, trigger_args)
Therefore, I think the remote object type should be the base class type rather than the top level super class type.
Environment
rpyc version: 4.1.2
python version: 3.6.5
operating system: Deepin 15.11
The text was updated successfully, but these errors were encountered:
I'm using
apscheduler
withrpyc
, the service expose two ofscheduler
's method.remove_job
works perfectly butadd_job
crashed.My local call is as follows:
This is the remote traceback: the
_create_trigger
method in theapscheduler
failed.As we can see from the source code of
_create_trigger
, it determines whether thetrigger
is an instance ofBaseTrigger
. The_trigger
variable created byCronTrigger.from_crontab(mirror.sync_time)
is an instance ofclass CronTrigger(BaseTrigger)
, therefore it's indeed an instance ofBaseTrigger
. However, the server end resolved this argument to an instance ofABCMeta
which cause the exception. Actually,BaseTrigger
is a subclass ofABCMeta
(class BaseTrigger(six.with_metaclass(ABCMeta))
).Therefore, I think the remote object type should be the base class type rather than the top level super class type.
Environment
The text was updated successfully, but these errors were encountered: