Ubuntu 16.04 bench newsite error

I am trying to install erpnext on ubuntu 16.04 manually.

Please see below info:

~/frappe-bench$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe

  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From https://github.com/frappe/erpnext
  • branch master -> FETCH_HEAD
    Already up-to-date.
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    Wrote ./assets/js/print_format_v3.min.js - 18k
    Wrote ./assets/js/frappe-web.min.js - 101k
    Wrote ./assets/js/form.min.js - 113k
    Wrote ./assets/js/report.min.js - 157k
    Wrote ./assets/js/erpnext.min.js - 36k
    Wrote ./assets/css/list.min.css - 6k
    Wrote ./assets/js/erpnext-web.min.js - 1k
    Wrote ./assets/css/report.min.css - 7k
    Wrote ./assets/css/frappe-web.css - 51k
    Wrote ./assets/js/list.min.js - 66k
    Wrote ./assets/js/dialog.min.js - 58k
    Wrote ./assets/js/desk.min.js - 874k
    Wrote ./assets/css/form.min.css - 2k
    Wrote ./assets/js/editor.min.js - 26k
    Wrote ./assets/css/erpnext.css - 1k
    Wrote ./assets/css/desk.min.css - 256k
    Wrote ./assets/css/module.min.css - 2k

Bench: Open source installer + admin for Frappe and ERPNext (https://erpnext.com)

~/frappe-bench$ mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 62
Server version: 10.1.14-MariaDB-1~xenial mariadb.org binary distribution

Copyright © 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> \q;
Bye

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

Please add this to MariaDB’s my.cnf and restart MariaDB before proceeding

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

================================================================================

Please help.
Thanks in advance.

You have to add this conf settings under my.cnf file.

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

Thanks for the reply.
The conf settings is already loaded as shown below.

$ sudo cat /etc/mysql/conf.d/barracuda.cnf

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

$ sudo mysqld --print-defaults
mysqld would have been started with the following arguments:
–innodb-file-format=barracuda --innodb-file-per-table=1 --innodb-large-prefix=1 --character-set-client-handshake=FALSE --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 --basedir=/usr --datadir=/var/lib/mysql --tmpdir=/tmp --lc-messages-dir=/usr/share/mysql --skip-external-locking --bind-address=127.0.0.1 --key_buffer_size=16M --max_allowed_packet=16M --thread_stack=192K --thread_cache_size=8 --myisam-recover=BACKUP --query_cache_limit=1M --query_cache_size=16M --log_error=/var/log/mysql/error.log --expire_logs_days=10 --max_binlog_size=100M --character-set-server=utf8 --collation-server=utf8_general_ci --character_set_server=utf8 --collation_server=utf8_general_ci --plugin-load-add=auth_socket.so

$ mysql --print-defaults
mysql would have been started with the following arguments:
–default-character-set=utf8mb4 --default-character-set=utf8

Hello im in ubuntu 16.04 the first site workfile then the next one have an error like that
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 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/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 56, in _new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 33, in install_db
create_database_and_user(force, verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 53, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 526, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 106, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 52, in connect
use_unicode=True, charset=‘utf8’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, “Access denied for user ‘root’@‘localhost’ (using password: YES)”) plz help

It seems MySQL root password is not correct.

1 Like

Thanks i done this :slight_smile:

Im facing similar issue, may i know how did u resolve the issue ?

nccchirag a search of ‘mysql reset root password’ turned up this

https://help.ubuntu.com/community/MysqlPasswordReset

I was able to resolve the issue by fixing the MySQL server. Configuration was not recognized due to version upgrade. Check your MySQL server logs. I just run the MySQL version upgrade script after several reinstallation of MySQL server.

@clarkej
root access is fixed … but I still get the below error

@kulaki - I also force upgraded mySQL …

Just for info - I had first installed mySQL then installed MariaDB … ( uninstall mySQL server )

===========================================
Creation of your site - site1.local failed because MariaDB is not properly
configured to use the Barracuda storage engine.
Please add the settings below to MariaDB’s my.cnf, restart MariaDB then
run bench new-site site1.local again.

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

ok solved it

re-installed mariadb with instructions mentioned at the below source

https://www.vultr.com/docs/how-to-install-apache-24-mariadb-10-and-php-7x-on-ubuntu-16-04

thank you

1 Like

Just leaving a note here for others who have the same problem:

My situation:

  • had mysql5.7 earlier and uninstalled it to install mariadb
  • Current OS Ubuntu 16.04
  • had followed ‘Manual Install’ method to install bench
  • was repetedly getting the 'Please add this to MariaDB's my.cnf and restart MariaDB before proceeding' error even after doing so.

Solution for my situation:
Added Password to '/etc/mysql/debian.cnf' (after a spending 2 day on the problem)

My guess on why it worked:
i guess bench gives that same error for all database related issues… So, there was some other underlying problem (relating to upgrade) which was giving an error.

i guess the error was related to this screenshot: (sorry, i only have a screenshot of the error)

2 Likes

Thank you!

The last folder checked for configurations files is /etc/mysql/mariadb.conf.d which contains a conf file overwritting what has already been loaded from /etc/mysql/conf.d/barracuda.cnf. E.g the output of mysqld --print-defaults shows you have multiple definitions of --collation_server=* the last of which is not correct. (only the last definition is used if there are multiple definitions).
The solution would be to move /etc/mysql/conf.d/barracuda.cnf to /etc/mysql/mariadb.conf.d/barracuda.cnf so that your custom options are read last.

1 Like