MultiTenancy: site_config.json does not exist

Just added 2 new sites to my installation and now cannot access any of the instances. Has anyone encountered this?

Thanks

Are you trying DNS or port based MultiTenancy?

Using DNS

@malik try:

bench setup ngin× 
sudo service nginx restart

Thanks for the advice. Everything was working well until I added a second and third instance following the wiki.

I have executed the commands but still no success.

I have …/sites/common_site_config.json

and

…/sites/site1.local/site_config.json

My question is how to instruct theh engine to recognize the ‘site_config.json’ files under each of the instances?

Please note that I have …/sites/currentsite.txt, which contains the first site.

Please help

Request Error
Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 52, in application
init_request(request)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 104, in init_request
frappe.init(site=site, sites_path=_sites_path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 121, in init
local.conf = _dict(get_site_config())
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 175, in get_site_config
raise IncorrectSitePath, “{0} does not exist”.format(site_config)
IncorrectSitePath: 404: Not Found
2016-09-11 03:22:05,042 - /home/ubuntu/frappe-bench/apps/frappe/frappe/app.py [ERROR]:
Site: biznext.com.ng
Request Error
Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 52, in application
init_request(request)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 104, in init_request
frappe.init(site=site, sites_path=_sites_path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 121, in init
local.conf = _dict(get_site_config())
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 175, in get_site_config
raise IncorrectSitePath, “{0} does not exist”.format(site_config)
IncorrectSitePath: 404: Not Found
2016-09-11 03:22:06,027 - /home/ubuntu/frappe-bench/apps/frappe/frappe/app.py [ERROR]:
Site: biznext.com.ng
Request Error
Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 52, in application
init_request(request)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 104, in init_request
frappe.init(site=site, sites_path=_sites_path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 121, in init
local.conf = _dict(get_site_config())
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 175, in get_site_config
raise IncorrectSitePath, “{0} does not exist”.format(site_config)
IncorrectSitePath: 404: Not Found
2016-09-11 03:28:12,395 - /home/ubuntu/frappe-bench/apps/frappe/frappe/app.py [ERROR]:
Site: biznext.com.ng
Request Error
Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 52, in application
init_request(request)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 104, in init_request
frappe.init(site=site, sites_path=_sites_path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 121, in init
local.conf = _dict(get_site_config())
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 175, in get_site_config
raise IncorrectSitePath, "{0}

At the end I created a symbolink like to the to my domain name to make this work. My question is whether this is the recommended way of setting up multenant environment. Will appreciate comments from your experience.

Thanks

@malik

Ideally, currentsite.txt should be empty if you plan to use multiple sites on the same port. And creating symlinks is not a recommended way for DNS multitenant setup.

Moreover, it is pretty confusing :confused: that there was not site_config.json in your second and third instance. Because it stores Database entries for db_name and db_password the sites which enable MySQL access and so it is obvious you were not able to access the newly created sites.

Thanks for your analysis. What do you suggest?

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.

How to set the correct root directly for the different sites?

I removed all other sites and now left with only …/site1.local …still getting the same issue with nginx:

@confusing - The files are there. The webserver could not reach the files because of wrong configuration. Will appreciate any help with NGINX configuration for DNS based multitenancy. I re-installed from scatch - and got to the same error immediately I added another instance.