Error email added to email queue stauts not sent

ERPNEXT version: 14.65.0
I’m trying to send emails but the email is added to the email queue with the status not sent, when I click send now the email is sent successfully
I tried to debug it and discover what’s the issue but Bench Doctor doesn’t work
I’m getting this exception when I run it
Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module> main() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main click.Group(commands=commands)(prog_name="bench") File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func ret = f(frappe._dict(ctx.obj), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 138, in doctor return _doctor(site=site) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 96, in doctor workers_online = check_number_of_workers() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 83, in check_number_of_workers return len(get_workers()) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 12, in get_workers workers = Worker.all() File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 257, in all workers = [ File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 258, in <listcomp> cls.find_by_key( File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 685, in find_by_key worker.refresh() File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 1041, in refresh queues = as_text(queues) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/utils.py", line 58, in as_text raise ValueError('Unknown type %r' % type(v)) ValueError: Unknown type <class 'NoneType'>

HI @k.taha3:

Is your bench in production or development mode?

Try
bench setup requirements

how I can check it ?

i got this exception after running the command

frappe@7f78146155e2:~/frappe-bench$  bench setup requirements
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade pip
Installing 3 applications...
ERROR: /home/frappe/frappe-bench/apps/frappe
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/site-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/bench/commands/setup.py", line 230, in setup_requirements
    bench.setup.requirements(apps=apps)
  File "/usr/local/lib/python3.10/site-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/bench/bench.py", line 464, in requirements
    app = App(path_to_app, bench=self.bench, to_clone=False).install(
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 186, in __init__
    super().__init__(name, branch, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 83, in __init__
    self.setup_details()
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 99, in setup_details
    self._setup_details_from_mounted_disk()
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 117, in _setup_details_from_mounted_disk
    self.git_repo = git.Repo(self.mount_path)
  File "/usr/local/lib/python3.10/site-packages/git/repo/base.py", line 276, in __init__
    raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: /home/frappe/frappe-bench/apps/frappe

Seems some issue with your environment/installing process.
Which method used to install Frappe + ERPNext?

docker-compose
i used this file :

Sorry, i have no experience enough with docker environment.
Hope someone else can help here.

Hi - I have the same issue after minor patch upgrade to 14.71. Also using a docker install.
@revant_one Any pointers here?

Make sure scheduler and workers are working. Make them work as background worker is needed to send email.

The system health check page says there are no background workers running although all containers are up. When I call bench doctor, I get this error below:

Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module> main() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main click.Group(commands=commands)(prog_name="bench") File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func ret = f(frappe._dict(ctx.obj), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 138, in doctor return _doctor(site=site) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 96, in doctor workers_online = check_number_of_workers() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 83, in check_number_of_workers return len(get_workers()) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 12, in get_workers workers = Worker.all() File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 257, in all workers = [ File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 258, in <listcomp> cls.find_by_key( File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 685, in find_by_key worker.refresh() File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/worker.py", line 1041, in refresh queues = as_text(queues) File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/rq/utils.py", line 58, in as_text raise ValueError('Unknown type %r' % type(v)) ValueError: Unknown type <class 'NoneType'>

Hi @revant_one any further clues based on the error message from.bench doctor?

Hi @k.taha3 did you manage to solve this? @revant_one any help here?