Installation error in ubuntu -16.04

Hello,

I have installed the ERPNext in Ubuntu 16.04.

The version which got installed is ERPNext- v12 develop and Frappe Framework v12

So, I tried the command as bench switch-to-master. It shows successfully switched to master.

After this i run the command as bench update --patch.

After running this command, i am getting the error as mentioned below;

root@ubuntu:/home/frappe/frappe-bench# bench update --patch
Backing up sites…
Patching sites…
Migrating site1.local
Executing execute:frappe.db.sql(“”“update tabComment set comment = substr(comment, 6, locate(”:“, comment)-6) where comment_type in (“Assigned”, “Assignment Completed”)”“”) in site1.local (_1bd3e0294da19198)
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, 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/lib/python3.5/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/decorators.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 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 227, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 38, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 81, in execute_patch
exec(patchmodule.split(“execute:”)[1],globals())
File “”, line 1, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 210, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, “Unknown column ‘comment’ in ‘field list’”)

How can I solve this issue?

Please help

Thanks & Regards,
Sujay

I’m getting this error when I tried to run the command bench update --patch

You should run the bench commands as a non-root user (from the info in your post, it seems the user should be frappe)

Hello,

Thank you for your response.

Can you tell me the commands which I need to use.

This is the right command, but run it as user frappe (not as user root). If oyu are already logged in as root, you can do it this way…

su frappe
cd ~/frappe-bench
bench update --patch

I have tried your commands, but still getting some error as shown below;

Maybe you can try this…

su frappe;
cd ~/frappe-bench;
bench --site all migrate

same error I’m getting after using these commands;

su frappe;
cd ~/frappe-bench;
bench --site all migrate

This seems to be where the source error occurs. I can only suggest one last thing to try, and then we’ll have to hope one of the proper experts can add in a fix if it doesn’t work.
If you go to mysql and run that command manually, and then have a look at its results for clues on how to fix it…

bench mysql

and then in the mysql system,

update tabComment set comment = substr(comment, 6, locate(':', comment)-6) where comment_type in ('Assigned', 'Assignment Completed')

Hello,

It’s not working.

Anyways thank you so much for helping me.

Hi,
I am getting the same error in ubuntu 16.04, Erpnext version 10.
your problem solved?

Try “bench setup requirements”