Installation on ubuntu 16.04 mariadb error

No matter what I do, I cannot get erpnext to install onto an ubuntu 16.04 lts server. I am starting from a fresh install of the o/s and using the easy install script. I am getting this error

$ bench new-site site1.local
================================================================================
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

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

What is irritating me, is these are set in the configuration and show up when queried

MariaDB [(none)]> SELECT * FROM information_schema.global_variables WHERE variable_name IN ('innodb_file_format', 'innodb_file_per_table', 'innodb_large_prefix','character_set_client_handshake', 'character_set_server','collation_server') ORDER BY variable_name;
+-----------------------+--------------------+
| VARIABLE_NAME         | VARIABLE_VALUE     |
+-----------------------+--------------------+
| CHARACTER_SET_SERVER  | utf8mb4            |
| COLLATION_SERVER      | utf8mb4_general_ci |
| INNODB_FILE_FORMAT    | Barracuda          |
| INNODB_FILE_PER_TABLE | ON                 |
| INNODB_LARGE_PREFIX   | ON                 |
+-----------------------+--------------------+
5 rows in set (0.00 sec)

I am running MariaDB v10.0.31. This install works just FINE on Debian 8, but Ubuntu has to be a PITA.

Any ideas?

Locate my.cnf
and add following to it

[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
Restart mysql service
sudo servie mysql restart
and then do bench new-site site1.local

Make sure you are editing the correct config file and don’t forget to restart the server for the changes to take effect

Hey @James_Robertson,
I was just having a similar problem a week ago, turns out the bench gives this error for all DB related errors.
So, My suggestion would be to check the logs of mariadb for any other errors.

I have also Documented my experience on a similar thread.

I would like to request any bench devs reading this to make the DB error reporting (in 'bench new-site' command) more transparent and let the user know what errors are happening under the hood.

1 Like

Thanks all for the tips. I ended up creating a more detailed and specific .cnf file that got rid of a ton of issues before running install.py

It will be in the next version of the erpnext admin guide

1 Like

Can you please publish your .cnf file. I am stuck on Ubuntu 16.04.3 for sometime now. Where did you add your .cnf file?
Thanks in advance.

Here you go. Run this as root.

cat > /etc/mysql/conf.d/zerpnext.cnf << "EOF"
# MariaDB Configuration for ERPNext on Debian/Ubuntu
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld]
basedir = /usr
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
datadir = /var/lib/mysql
innodb-file-format = barracuda
innodb-file-per-table = 1
innodb-large-prefix = 1
log-error = /var/log/mysql/mysql-error.log
pid-file = /var/run/mysqld/mysqld.pid
port = 3306
slow-query-log-file = /var/log/mysql/mysql-slow.log
socket = /var/run/mysqld/mysqld.sock
tmpdir = /tmp
user = mysql
    
[mysql]
default-character-set = utf8mb4

EOF

Thanks James, but this fix did not work for me, the problem persists. There is no error log for mysql either. :confused:

boxer@mitra:~/erpnext/frappe-bench$ mysql --print-defaults
mysql would have been started with the following arguments:
–default-character-set=utf8mb4 --port=3306 --socket=/var/run/mysqld/mysqld.sock --default-character-set=utf8mb4 --default-character-set=utf8mb4 --default-character-set=utf8mb4 --default-character-set=utf8mb4

I get the same error on a fresh Ubuntu 17.10 server VM. I am at my wits end. This does not seem like a frappe problem. Need help from the Mariadb experts, anyone…

After a lot of hacking around, I could solve this problem and was able to create a site.
I added the frappe recommended configuration to /etc/mysql/my.cnf, that seem to have done the trick.
I have tested this on Ubuntu 16.04.3 as well as Ubuntu 17.10

Please remember to restart the server, after the configuration change!!

FWIW, these steps have been tested on Ubuntu 16.04 both desktop and server versions.

https://jwrober.github.io/erpnext_admin_guide/i-u-b/install

I had the same problem for the last 3 days. On a fresh Debian 9 install using the Easy installer.

I was putting the mysql configuration entries in /etc/mysql/my.cnf but I kept getting the same error even though, like the OP, when querying mysql it was showing Barracuda as the main storage engine.

The solution was to put the configuration in this file: “/etc/mysql/mariadb.conf.d/erpnext.cnf”

The solution was suggested by wava in this thread: Ubuntu 16.04 bench newsite error - #13 by Tuan_Nguyen

Actually it is better to put the configuration it in: /etc/mysql/mariadb.conf.d/50-server.cnf