Cant Open any page after bench update

Request Error
Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 55, in application
response = frappe.handler.handle()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 19, in handle
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 36, in execute_cmd
ret =, **frappe.form_dict)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 879, in call
return fn(*args, **newargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/”, line 70, in getdoctype
docs = get_meta_bundle(doctype)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/”, line 81, in get_meta_bundle
bundle = [frappe.desk.form.meta.get_meta(doctype)]
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/”, line 20, in get_meta
meta = frappe.cache().hget(“form_meta”, doctype, lambda: FormMeta(doctype))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/”, line 161, in hget
value = generator()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/”, line 20, in
meta = frappe.cache().hget(“form_meta”, doctype, lambda: FormMeta(doctype))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/”, line 32, in init
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/”, line 39, in load_assets
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/”, line 59, in add_code
path = os.path.join(get_module_path(self.module), ‘doctype’, scrub(
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/”, line 29, in get_module_path
return frappe.get_module_path(module)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 659, in get_module_path
return get_pymodule_path(local.module_app[module] + “.” + module, *joins)
KeyError: u’selling’
2016-09-12 01:42:40,900 - /home/ubuntu/frappe-bench/apps/frappe/frappe/utils/ [ERROR]:
New Exception collected with id: 2016-09-12 01:42:40.896994-

Run bench migrate and try again.

Thanks Kanchan -

I ran bench migrate – still same issues.
I can logon but can’t open any document … like customers,

Still getting this. Any idea, anyone?

I think you have somehow removed “erpnext” from list of apps

Just checked the …/sites folder and I have the ‘erpnext’ listed there. Also, I have the app ‘erpnext’ under …/apps folder.

This issue started after I added additional instances using ‘DNS Multitenancy’. Initially, the ‘site_config.json’ was not found for any of the instances. To resolve this, i did a symbolic link instance folders under …/site/<instance_folder> to get the sites up.

So, my final analysis is that the DNS Multitenancy is not installed or configured correctly.

Could you please share the NGINX config for ‘DNS Multitenancy’ set up with me?

Thank you for the good work!


I assume you have set dns_multitenant: 1 in common_site_config.json in your sites folder.

After that you will have to run bench setup nginx --yes to regenerate Nginx configuration files for the bench.

Also, reload the Nginx sudo service nginx reload

This should probably resolve the issue, if it is just related to nginx and multi-tenancy

Thanks - will try these steps and see. Appreciate your time

Below is an extract from the conf file after running the suggested commands. Same issue persists, I am looking at nginx docx, appreciate any help from anyone

server {
listen 80;

    root /home/ubuntu/frappe-bench/sites;
    location /assets {
            try_files $uri =404;
    location ~ ^/protected/(.*) {
            try_files /$host/$1 =404;
    location / {
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header X-Frappe-Site-Name $host;
            proxy_set_header Origin $scheme://$http_host;
            proxy_set_header Host $host;
            proxy_pass http://frappe-bench-socketio-server;
    location / {
            try_files /$host/public/$uri @webserver;
    location @webserver {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Frappe-Site-Name $host;
            proxy_set_header Host $host;
            proxy_set_header X-Use-X-Accel-Redirect True;
            proxy_read_timeout 120;
            proxy_redirect off;
            proxy_pass  http://frappe-bench-frappe;
    # error pages
    error_page 502 /502.html;
    location /502.html {
            root /home/ubuntu/bench-repo/bench/config/templates;

The #server map block is empty, could this be the issue? I am thinking for a multitenancy the mapping of the different domain to the respective folders should be on the nginx config. This is not being done automatically, so need to add manually.