Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APScheduler KeyError: 'cron' during startup #2653

Closed
MeisterLLD opened this issue Jan 11, 2023 · 2 comments
Closed

APScheduler KeyError: 'cron' during startup #2653

MeisterLLD opened this issue Jan 11, 2023 · 2 comments

Comments

@MeisterLLD
Copy link

MeisterLLD commented Jan 11, 2023

Describe the bug/problem
Launching cps in a terminal gives me the following message. Last time I've tried before that, it worked well.

Traceback (most recent call last):
File "/home/lld/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 900, in _create_plugin_inst
plugin_cls = class_container[alias]
KeyError: 'cron'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 3037, in _dep_map
return self.__dep_map
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 2834, in getattr
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/lld/.local/bin/cps", line 8, in
sys.exit(main())
File "/home/lld/.local/lib/python3.10/site-packages/calibreweb/cps/main.py", line 26, in main
app = create_app()
File "/home/lld/.local/lib/python3.10/site-packages/calibreweb/cps/init.py", line 173, in create_app
register_scheduled_tasks(config.schedule_reconnect)
File "/home/lld/.local/lib/python3.10/site-packages/calibreweb/cps/schedule.py", line 67, in register_scheduled_tasks
scheduler.schedule(func=end_scheduled_tasks, trigger='cron', name="end scheduled task", hour=end_time.hour,
File "/home/lld/.local/lib/python3.10/site-packages/calibreweb/cps/services/background_scheduler.py", line 52, in sch
return self.scheduler.add_job(func=func, trigger=trigger, name=name, **trigger_args)
File "/home/lld/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 424, in add_job
'trigger': self._create_trigger(trigger, trigger_args),
File "/home/lld/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 925, in _create_trigger
return self._create_plugin_instance('trigger', trigger, trigger_args)
File "/home/lld/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 903, in _create_plugin_inst
plugin_cls = class_container[alias] = plugin_container[alias].load()
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 2470, in load
self.require(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 2492, in require
reqs = self.dist.requires(self.extras)
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 2755, in requires
dm = self._dep_map
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 3039, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 3056, in _compute_dependencies
common = types.MappingProxyType(dict.fromkeys(reqs_for_extra(None)))
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 3053, in reqs_for_extra
if not req.marker or req.marker.evaluate({'extra': extra}):
File "/home/lld/.local/lib/python3.10/site-packages/packaging/markers.py", line 241, in evaluate
return _evaluate_markers(self._markers, current_environment)
File "/home/lld/.local/lib/python3.10/site-packages/packaging/markers.py", line 150, in _evaluate_markers
lhs_value, rhs_value = _normalize(lhs_value, rhs_value, key=environment_key)
File "/home/lld/.local/lib/python3.10/site-packages/packaging/markers.py", line 124, in _normalize
return tuple(canonicalize_name(v) for v in values)
File "/home/lld/.local/lib/python3.10/site-packages/packaging/markers.py", line 124, in
return tuple(canonicalize_name(v) for v in values)
File "/home/lld/.local/lib/python3.10/site-packages/packaging/utils.py", line 34, in canonicalize_name
value = _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or bytes-like object

Before that cps complained that I didn't have the python module 'certifi', so I installed it. It didn't need it until more or less recently. Sorry that I can't be more precise, I haven't been using calibre-web in a few weeks.

To Reproduce
Steps to reproduce the behavior: launch cps.

Logfile
My logfile has no useful info, the last entry is from 2022-11-14 when it worked.

Expected behavior
No Python exceptions.

Screenshots

Environment (please complete the following information):

  • OS: Arch Linux 6.1.4
  • Python version: 3.10.9
  • Calibre-Web version: Calibre-Web version: 0.6.19 - unknown git-clone
@OzzieIsaacs
Copy link
Collaborator

Error is caused by not properly installed AP Scheduler dependency (reference: agronholm/apscheduler#77)

OzzieIsaacs pushed a commit that referenced this issue Jan 15, 2023
@OzzieIsaacs OzzieIsaacs changed the title Several Python exceptions APScheduler KeyError: 'cron' during startup Jan 15, 2023
@rsulliv1
Copy link

rsulliv1 commented Feb 8, 2023

cause of Technosoft2000/docker-calibre-web#125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants