ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Problem with creating database table

I have a problem when creating a new site as follows:

% sudo bench new-site erp.test.com
MySQL root password: 
ERROR 4047 (HY000) at line 10: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Table 'tabDefaultValue' missing in the restored site. Database not installed correctly, this can due to lack of permission, or that the database name exists. Check your mysql root password, validity of the backup file or use --force to reinstall

As I figured out, the default tables are not created as expected. because when I ran:

% bench --site erp.test.com install-app erpnext
I got this:
An error occurred while installing erpnext:
(1146, “Table ‘_795edb06adf65e00.tabDefaultValue’ doesn’t exist”)

to reassure I logged into MariaDB shell and I got this:

MariaDB [(none)]> use _795edb06adf65e00
Database changed
MariaDB [_795edb06adf65e00]> show tables;
Empty set (0.001 sec)

Any advice please, how to create these default tables?

Thank you.

do you have site1.local created on your system as part of easy install?

Hello, I’m having the same problem. @neerajvkn would that show in the /sites directory? If so, I don’t have that created on my system.

Use older Mariadb for now. Preferably 10.3

Or change code for new site creation to complete Table 'tabDefaultValue' missing Error When creating new site

I’m also facing this issue when trying to force restore from a backup of an existing production site (on mariadb version 10.3.30) on a local instance running mariadb version 10.4.13. The site does not have ERPNext installed. Only 1 custom app on top of Frappe.

ERROR 2006 (HY000) at line 2591: MySQL server has gone away
Table 'tabDefaultValue' missing in the restored site. Database not installed correctly, this can due to lack of permission, or that the database name exists. Check your mysql root password, validity of the backup file or use --force to reinstall

I have also tried to restore by downgrading the local instance mariadb version to 10.3.30 from 10.4.13 but I’m seeing the same error while restoring

Another observation:

On the production instance running on Ubuntu, table names are case sensitive so tabdefaultvalue doesn’t exist but tabDefaultValue does. On the other hand, on my local instance running on macOS, table names are not case sensitive so both tabdefaultvalue and tabDefaultValue exist and return the same table. I don’t know if this is part of the problem.

EDIT: Doesn’t seem to be a Mac issue since the same error’s there while trying to restore on Ubuntu

SOLVED: Increased the max_allowed_packet (default value on Mac was 16777216) to 107374182 after following this article https://tableplus.com/blog/2018/11/mysql-server-has-gone-away-solved.html