Multitentant Setup - Errors with DNS based setup

Hi,

I have tried to setup a fresh machine today. I have setup a new and fresh erpnext - everything worked perfect. Then I tried the following:

example@erpdoo:~$ bench set-url-root site1.local hoth.example.at
example@erpdoo:~$ bench new-site naboo
MySQL root password: 
Installing frappe...
Updating frappe                     : [========================================]
Updating country info               : [========================================]
Set Administrator password: 
Re-enter Administrator password: 
Installing fixtures...
*** Scheduler is disabled ***
example@erpdoo:~$ bench --site naboo install-app erpnext
Installing erpnext...
Updating erpnext                    : [========================================]
Installing fixtures...
example@erpdoo:~$ bench setup nginx
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==2.0.0', 'console_scripts', 'bench')()
  File "/home/example/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/example/bench-repo/bench/commands/setup.py", line 21, in setup_nginx
    make_nginx_conf(bench_path=".")
  File "/home/example/bench-repo/bench/config/nginx.py", line 14, in make_nginx_conf
    sites = prepare_sites(config, bench_path)
  File "/home/example/bench-repo/bench/config/nginx.py", line 52, in prepare_sites
    raise Exception("Port {0} is being used by another site {1}".format(site["port"], ports_in_use[site["port"]]))
Exception: Port 80 is being used by another site naboo
example@erpdoo:~$     bench config dns_multitenant off
example@erpdoo:~$ bench setup nginx
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==2.0.0', 'console_scripts', 'bench')()
  File "/home/example/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/example/bench-repo/bench/commands/setup.py", line 21, in setup_nginx
    make_nginx_conf(bench_path=".")
  File "/home/example/bench-repo/bench/config/nginx.py", line 14, in make_nginx_conf
    sites = prepare_sites(config, bench_path)
  File "/home/example/bench-repo/bench/config/nginx.py", line 52, in prepare_sites
    raise Exception("Port {0} is being used by another site {1}".format(site["port"], ports_in_use[site["port"]]))
Exception: Port 80 is being used by another site taboo

Best,
Dan

Hi,

You need to turn run bench config dns_multitenant on not bench config dns_multitenant off and then run bench setup nginx

Also if you want naboo to be your subdomain, like naboo.example.at, you want to name the site exactly that.

Ps : Maybe you wanna use Endor as your site instead of Naboo. Personal preference :wink:

1 Like

damnit…i knew there were just a little mistake. working now.

why choose Endor oder Naboo :wink: ? Btw. my instances are Hoth, Naboo and Dagobah ^^
Because of the last battle on Endor where they last striked against the Empire? Well sounds great :wink: maybe for the fourth instance ^^

Hey if you wanna be recent, go for Jakku, but it sounds terribly boring :slight_smile:

I am having Jakku in Battlefront :wink: no need to have it as instance. But I guess 4 instances is enough for now;)

Btw my Erpnext4 production instance is called isengard;) so names and places are there ;p

1 Like

Hi @vjFaLk, I managed to install multiple sites, however they seem incomplete, I can only see Tools, File manager, Website and Developer module/menu for each site:

Looks like only the Frappe framework was installed not the ERPNext:

Below were the commands:

root@localhost:/home/frappe# cd frappe-bench
root@localhost:/home/frappe/frappe-bench# bench new-site ledgergeek.com
MySQL root password:
Installing frappe…
Updating frappe : [========================================]
Updating country info : [========================================]
Set Administrator password:
Re-enter Administrator password:
Installing fixtures…
*** Scheduler is disabled ***
root@localhost:/home/frappe/frappe-bench# bench setup nginx
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/setup.py”, line 22, in setup_nginx
make_nginx_conf(bench_path=“.”, yes=yes)
File “/home/frappe/.bench/bench/config/nginx.py”, line 13, in make_nginx_conf
sites = prepare_sites(config, bench_path)
File “/home/frappe/.bench/bench/config/nginx.py”, line 60, in prepare_sites
for site in get_sites_with_config(bench_path=bench_path):
File “/home/frappe/.bench/bench/config/nginx.py”, line 106, in get_sites_with_config
site_config = get_site_config(site, bench_path=bench_path)
File “/home/frappe/.bench/bench/config/site_config.py”, line 11, in get_site_config
return json.load(f)
File “/usr/lib/python2.7/json/init.py”, line 290, in load
**kw)
File “/usr/lib/python2.7/json/init.py”, line 338, in loads
return _default_decoder.decode(s)
File “/usr/lib/python2.7/json/decoder.py”, line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python2.7/json/decoder.py”, line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 4 column 1 (char 70)
root@localhost:/home/frappe/frappe-bench# sudo service nginx reload

  • Reloading nginx configuration nginx

I can see there was ValueError, but don’t know what it was. Could it be the cause?

Thanks

Hi all, I managed to sort it out. I installed erpnext using this command after creating a new site:
bench --site <site.name> install-app erpnext

And it works ok.
However I still have a bit question, why this additional command is not required on the official multitenant installation guides?

Cheers