Multitenant setup please help

@Dany_Carvalheiro

Aaa there’s so much happening here!

Okay, so:

  1. Make sure DNS Multitenancy is ON
  2. Make sure the exact domain you want to use is the name of the site in bench
  3. Make sure there is no currentsite.txt inside sites, if there is, delete the file
    4a) Either add an A record with the right subdomain on your DNS or
    4b) Add an entry in /etc/hosts (C:\Windows\System32\drivers\etc\hosts if you’re accessing the site from Windows :tired_face:) file pointing your subdomain name to the DO IP like this :
123.456.678    subdomain.website.com

Make sure to add the entry on the OS where you’re ACCESSING the site from, not where ERPNext is being served from.

Also generate nginx config again just in case using bench setup nginx followed by restarting nginx by doing sudo service nginx restart

Why is needed? DNS should resolve the name …if it is a public domain as it should be …

I’m talking in context of adding it to the hosts file

oh k :+1:

hi thank you very much i sorted it was the dns problem

but now i am facing this issue i made the easy installation

so every time i create more than one or tree sites i am having this error

File “/usr/lib/python2.7/runpy.py”, line 162, 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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, 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 716, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core .py”, line 696, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core .py”, line 1060, 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 1060, 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 889, 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 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/deco rators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 2 4, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 150, in install_app
_install_app(app, verbose=context.verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 131, in i nstall_app
sync_for(name, force=True, sync_everything=True, verbose=verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py”, line 43, in s ync_for
import_file_by_path(doc_path, force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 54, in import_file_by_path
import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 122, in import_doc
doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 231, in insert
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 728, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 839, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 822, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 655, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype. py”, line 139, in on_update
make_module_and_roles(self)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype. py”, line 599, in make_module_and_roles
r.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 229, in insert
self.run_method(“after_insert”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 839, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 822, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 655, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/role/role.py”, l ine 19, in after_insert
user.add_roles(self.name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, l ine 321, in add_roles
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 242, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 285, in _save
self.update_children()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 293, in update_children
self.update_child_table(df.fieldname, df)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 302, in update_child_table
d.db_update()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 326, in db_update
), d.values() + [name])
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 137, in sq l
self._cursor.execute(query, values)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cu rsors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/co nnections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (2013, ‘Lost connection to MySQL server during query’)
root@ubuntu-512mb-lon1-01:/home/frappe/frappe-bench# mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/m ysqld/mysqld.sock’ (111 “Connection refused”)

it seems mysql password either is wrong or service is not correctly installed …i suggest to have a new frappe/erpnext installation from scratch …

its not the password i have now copying the password for a file to do not miss but its keep craching, i have did the new frappe from scratch for 4 times now but is keep doing the same error after i create multiple sites or someting i am doing on this process

well …Can’t connect to local MySQL server through socket ‘/var/run/m ysqld/mysqld.sock’ means Mysql is not correctly up and running …google around to find a solution or install from scratch once more …all up to you …

i tryied but no success i thought you could have face the same problem if not ops i will keep searching

never got that problem …sorry

yes thanks for the feedback

its normal not have the bench folder as i am showing on the picture below

u shouldn’t install as root user …and 512MB ram is a bit to small …

wich user should i use?

create a new one …call it as u prefer …like frappe or myuser or whathever u like …

login as the new user and install …

ok will try like that, but i should have the bench-repo folder?

nope …install like u did until now …just create and login as the new user

i tried with the non root user still having the same erro has the one a posted,
its happend when i configure my second site and i make changes on the database or someting on the system and i try to create another one or make changes on the databases and than it crash just like that not getting why, can it be cause by low memory or someting like that? maybe