Bench new-site site2name : Permission denied makedir

Hi All,I trust your are doing well.
I try to install a multitenant by following the instruction on github: Multitenant Setup · frappe/bench Wiki · GitHub

I try to execute the ‘bench new-site site2name’ from the frappe-bench directory.
I got the error: OSError: [Errno 13] Permission denied: ‘./site2name’ and the directory is not created

See log:
ubuntu@IP:/home/frappe/frappe-bench$ bench new-site site2name
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, 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 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, 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 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, 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 1066, 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 895, 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 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 29, in new_site
verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 53, in _new_site
make_site_dirs()
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 324, in make_site_dirs
os.makedirs(dir_path)
File “/home/frappe/frappe-bench/env/lib/python2.7/os.py”, line 150, in makedirs
makedirs(head, mode)
File “/home/frappe/frappe-bench/env/lib/python2.7/os.py”, line 150, in makedirs
makedirs(head, mode)
File “/home/frappe/frappe-bench/env/lib/python2.7/os.py”, line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: ‘./site2name’

Can somebody tell me how to solve this issue?

Kind regards,
PB

Did you try

sudo bench new-site site2name

Hi,
You have to execute bench commands as frappe user, hope you ran the easy install script.

sudo su - frappe

Thanks

Hi, It works now! :slight_smile: ‘sudo su - frappe’ did the trick! thanks for all responses!