New installation Issue

Hi I was trying to setup Erpnext manually using this link

And site is not getting created when i run bench new-site site1.local
Please help me to find out the solution for this error as i am new to erpnext.

Attatching full log here:

:~/frappe-bench$ bench new-site site1.local
MySQL root password:

Installing frappe…
Updating DocTypes for frappe : [======= ] 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/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 97, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py”, line 33, in new_site
db_type = db_type)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py”, line 70, in _new_site
_install_app(app, verbose=verbose, set_as_patched=not source_sql)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 84, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_perm issions=True)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/sync.py”, line 56, in sync_for
reset_permissions=reset_permissions, for_sync=True)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 66, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 141, in import_doc
doc.insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 25 8, in insert
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 91 7, in run_post_save_methods
self.run_method(“on_update”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 78 6, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 56, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 39, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 78 0, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctyp e.py”, line 268, in on_update
self.run_module_method(“on_doctype_update”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctyp e.py”, line 337, in run_module_method
getattr(module, method)()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/communication/ communication.py”, line 289, in on_doctype_update
frappe.db.add_index(“Communication Link”, [“link_doctype”, “link_name”])
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/mariadb/database.p y”, line 252, in add_index
if not self.has_index(table_name, index_name):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/mariadb/database.p y”, line 244, in has_index
index_name=index_name
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/database.py”, line 171, in sql
self._cursor.execute(query)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/ cursors.py”, line 170, in execute
result = self._query(query)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/ cursors.py”, line 328, in _query
conn.query(q)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/ connections.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/ connections.py”, line 732, in _read_query_result
result.read()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/ connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/ connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/ protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/ err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, u"Table ‘_1bd3e0294da19198.tabCommunication Link’ doesn’t exist")

There are two ways to solve this issue:

Option 1. Change table name in setting.json which can be found frappe-bench/sites/site1.local, it should look something like following

{
 "db_name": "<change_this>",
...

Option 2. You need to delete above mentioned DB, this can be done using

mysql -u root -p
DROP DATABASE _1bd3e0294da19198;

Once you’ve tried either of the option, you might want to run bench new-site site1.local again

Thanks for the reply.

I tried both solutions you just suggested but there is no luck

I’ve tried to drop db but it showing the same error when i run bench new-site site1.local command

And i’ve tried to change “db_name” into “site1.local” inside /frappe-bench/sites/site1.local/site_config.json , then it showing like pymysql.err.ProgrammingError: (1146, u"Table ‘site1.local.tabCommunication Link’ doesn’t exist")

I am curious as so which section are you following from bench’s documentation. Can you start from scratch and try Easy Install section. On the other-hand if you’re already following that can you please share which Linux Distro and Version you’re using? {So as to re-produce this issue}

I’m following Manual installation section in Ubuntu 18.04 LTS version

Try following the instructions on this guide - Home · frappe/frappe Wiki · GitHub

We have been consistently successful with it. If you are familiar with basic Python development, you may want to also set up a virtualenv just before running pip install -e ./bench

2 Likes

Now it’s worked for me with this link. Thanks for saving my time @tejpochiraju

I’m experiencing exactly the same issue when following the Easy Install. It used to work for me so I’m not sure if it was because of new bench commits. The installation fails at the creation of a new site.

For me it’s a branch issue. If I use master branch, everything is fine, if develop then the pymysql.err.ProgrammingError: (1146, u"Table '_1bd3e0294da19198.tabCommunication Link' doesn't exist") error crashes setup.

ENV:
OS: debian:9.6-slim (Dokcer)

I can confirm that it is a branch error. installing master branch works