Setting up ERPNext fails

I get the following fail when starting ERPNext for the first time.
I set “developer_mode”: 0 in site_config.json file.

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 19, in handle
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 42, in execute_cmd
ret =, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 904, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/page/setup_wizard/”, line 35, in setup_complete
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/page/setup_wizard/”, line 96, in update_user_name
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 193, in insert
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 770, in run_before_save_methods
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 667, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 888, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 873, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/employee/”, line 181, in validate_employee_role
if “Employee” in [d.role for d in doc.get(“user_roles”)]:
TypeError: ‘NoneType’ object is not iterable

Hi @Jasper

Kindly restart the supervisor using command sudo supervisorctl restart all and check
Also can you share the branch details of your applications? To get branch details, run command git branch in cd frappe-bench/apps/erpnext/ and frappe-bench/apps/frappe/ folder

Hi rohit_w
Same fault after running sudo supervisorctl restart all, see result from command git branch below:

Hi @Jasper

Your frappe application is on develop branch and erpnext on master branch. Kindly switch erpnext application from master to develop branch, it will resolved your issue.

Hi rohit_w
Thank for your fast reply. I used command sudo bench switch-to-develop but got an error:

Hi @Jasper

Run command bench update --patch

I have tried command bench update --patch, same result.