Bench doctor does not run

trying to get email working following this thread: [

](Email Settings are not working for outgoing email)

when I try bench doctor , the following appears:

http://imgur.com/9uEuMRG

this appears to be upstream/develop branch

Can you give a full traceback? I’m unable to read everything.

Here it is:

frappe@erpnext:~/frappe-bench$ bench doctor
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 852, 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 85, in check_number_of_workers
return len(get_workers())
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py”, line 10, in get_workers
with Connection(get_redis_conn()):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 136, in get_redis_conn
raise Exception(‘You need to call frappe.init’)
Exception: You need to call frappe.init

I don’t know if the output of: bench run-tests can help

frappe@erpnext:~/frappe-bench$ bench run-tests
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 799, in run_tests
force=context.force, profile=profile)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 39, in main
ret = run_all_tests(app, verbose, profile)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 74, in run_all_tests
_add_test(app, path, filename, verbose, test_suite=test_suite)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 164, in _add_test
make_test_records(doctype, verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 180, in make_test_records
make_test_records(options, verbose, force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 181, in make_test_records
make_test_records_for_doctype(options, verbose, force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 226, in make_test_records_for_doctype
frappe.local.test_objects[doctype] += make_test_objects(doctype, test_module.test_records, verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 273, in make_test_objects
d.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 205, in insert
self.db_insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 299, in db_insert
self.show_unique_validation_message(e)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 283, in db_insert
), d.values())
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 136, in sql
self._cursor.execute(query, values)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
frappe.exceptions.UniqueValidationError: (u’Purchase Order’, u’_T-Purchase Order-00002’, IntegrityError(1062, “Duplicate entry ‘_T-Purchase Order-’ for key ‘naming_series’”))

sorry off topic, what’s bench doctor for?

I’m unable to send emails, so was following this thread : https://discuss.erpnext.com/t/email-settings-are-not-working-for-outgoing-email/6712/2