Pending background jobs after upgrade from V6 to V7

Hi, all,

After following tips from [HOWTO] Six Step Guide to Upgrade from V6 to V7 and [SOLVED] ImportError: No module named psutil, I’ve managed to upgrade to V7.

I think the systems is running well after upgrade, except if I run $bench show-pending-jobs, I have the following texts. I am not sure what is the consequence if I purge these texts with $bench purge-jobs.

Any idea? Thank you in advance

Regards,
Lucky

$ bench show-pending-jobs
-----Pending Jobs-----
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 132, in show_pending_jobs
    return _pending_jobs(site=site)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 129, in pending_jobs
    pending_jobs = get_pending_jobs(site)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 73, in get_pending_jobs
    q = get_queue(queue)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 157, in get_queue
    return Queue(queue, connection=get_redis_conn(), async=async)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 168, in get_redis_conn
    raise Exception('You need to call frappe.init')
Exception: You need to call frappe.init

Pass a site id bench --site [sitename] show-pending-jobs

This is the output. I think I cannot tell any differences with before.

~/frappe-bench$ bench --site [site-name] show-pending-jobs
-----Pending Jobs-----
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 132, in show_pending_jobs
    return _pending_jobs(site=site)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 129, in pending_jobs
    pending_jobs = get_pending_jobs(site)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 73, in get_pending_jobs
    q = get_queue(queue)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 157, in get_queue
    return Queue(queue, connection=get_redis_conn(), async=async)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 168, in get_redis_conn
    raise Exception('You need to call frappe.init')
Exception: You need to call frappe.init

@luckyismail pelase add your site-name instead of site-name

Hi,
Here is the output. Still, I think it is not different with before.

$ bench --site lab01.computa.asia show-pending-jobs
-----Pending Jobs-----
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_f
unc
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 132, in show_pending_jobs
    return _pending_jobs(site=site)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 129, in pending_jobs
    pending_jobs = get_pending_jobs(site)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 73, in get_pending_jobs
    q = get_queue(queue)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 157, in get_queue
    return Queue(queue, connection=get_redis_conn(), async=async)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 168, in get_redis_conn
    raise Exception('You need to call frappe.init')
Exception: You need to call frappe.init

Hi All,

I have tried to execute $ bench purge-jobs and run $ bench show-pending-jobs again. It shows the same output with before.

Lucky

Hi all,

I have tested this issue on fresh ERPNext VM image. It shows similar output when I execute $ bench show-pending-jobs. Bugs?

-Lucky