Scheduler is not working

hi guys
i am trying with this code but scheduler is not working i don’t know why can you please check

scheduler_events = {
“all”: [

please help any body

did you enable the schedular via command line?
bench --site enable-scheduler

If yes, you can see in the logs (both in the server and in erp website) if anything came up.

Then you can make sure your methods works as expected with:
bench --site site1.local execute custom_app.custom_app.auto_import.auto_import

Finally you can trigger it manually to see if the error is with the scheduler or something:
bench --site site1.local trigger-scheduler-event all


i am getting error on bench --site site1.local trigger-scheduler-event all

Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 97, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 30, in trigger_scheduler_event
frappe.utils.scheduler.trigger(site, event, now=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 185, in trigger
scheduler_task(site=site, event=event, handler=handler, now=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 281, in scheduler_task
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 1019, in get_attr
return getattr(get_module(modulename), methodname)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 800, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python2.7/importlib/”, line 37, in import_module
ImportError: No module named auto_importbiometric_attendance.biometric_attendance.api

if your file (which contains your method) is in the same location as your, then you need to remove your first custom_app:

“all”: [

thanks for you support

both file is not in same folder

like for custom app hooks file would be custom_app/custom_app

but my file is in custom_app/custom_app/custom_app
then auto_import and api file

when you’re using the import, you always need to remove 1 custom_app from your path.
so the path would always look like: custom_app.(here we are at the level:) api.testing
→ usually, the file is at the same level as

if you open the bench console, try to import your method as you did before. Check if you can call the method. If you can, then try to do the other step I mention above.

actaully i have tried with another approach for testing purpose i did doc_events before_save so when ever i am clicking button save on given doctype on that time its working fine
so i am using same path for scheduler_event but that’s not working

Well that’s weird because you have an import error somewhere.
Try to search for that line: auto_importbiometric_attendance in your server. I’m sure it’s a typo, but maybe you have a file name like that.

My last option would be to execute this line: bench --site site1.local execute custom_app.custom_app.auto_import.auto_import
Which will run your method and maybe give a more precise log?

yeah i have done bench --site site1.local execute custom_app.custom_app.auto_import.auto_import
both file executed fine


Sorry if I budged in here but I just would like to ask, after I run this “bench --site site1.local trigger-scheduler-event all” bench showed me this “Event all does not exist!”?

Looks like you’ve just forgotten a comma somewhere. Python implicitly concatenates strings if comma is missing.

so ["frappe" "erpnext"] becomes ["frappeerpnext"]

Did you get your answer?

I have the same problem with the scheduler. It does not work…

I have enabled the scheduler via bench command
The i have triggered the all an cron event via bench command.
I get the message in the console “Event all does not exist!”

And i have created the events in the correctly…

scheduler_events = {
“all”: [
“cron”: {
“0/1 * * * *”: [