Get error "Table 'tabDefaultValue' missing in the restored site" when creating new site

The command I ran and the message I got

bench new-site mysite.local --mariadb-root-password mariadb \
  --db-host 127.0.0.1 \
  --db-port 3307 \
  --db-name mysite \
  --db-password mariadb_pw \
  --admin-password 123456
Warning: MariaDB version ['11.4', '4'] is more than 10.8 which is not yet tested with Frappe Framework.
Table 'tabDefaultValue' missing in the restored site. This happens when the backup fails to restore. Please check that the file is valid
Do go through the above output to check the exact error message from MariaDB

I checked on the database, the table was there with the name tabdefaultvalue.

Bench version

➜ bench version
erpnext 15.49.3
frappe 15.53.0
hrms 15.38.2

MariaDB:

  • Docker image mariadb:lts
  • Added config lower_case_table_names = 1

Machine: Apple Macbook Pro
Chip: M4 Pro.

I read the topic Table 'tabDefaultValue' missing Error When creating new site - #4 by Waqas_Tariq but it seems like another error

UPDATED

Here are the tables

MariaDB [mysite]> show tables;
+-------------------+
| Tables_in_mysite  |
+-------------------+
| __auth            |
| tabdefaultvalue   |
| tabdocfield       |
| tabdocperm        |
| tabdoctype        |
| tabdoctype action |
| tabdoctype link   |
| tabfile           |
| tabseries         |
| tabsessions       |
| tabsingles        |
+-------------------+

Hi,

Did the site get created despite the warning?

Does bench --site mysite.local migrate complete if it did?

Hello @smino ,

The site is created but there is not enough tables in the database. I tried your suggestions and got another error

pymysql.err.ProgrammingError: ('DocType', 'Patch Log')

Here are the tables

MariaDB [mysite]> show tables;
+-------------------+
| Tables_in_mysite  |
+-------------------+
| __auth            |
| tabdefaultvalue   |
| tabdocfield       |
| tabdocperm        |
| tabdoctype        |
| tabdoctype action |
| tabdoctype link   |
| tabfile           |
| tabseries         |
| tabsessions       |
| tabsingles        |
+-------------------+

Clearly the site didn’t install. Probably need to drop it/reinstall and try again.

The manual install for macs is a little different : https://docs.frappe.io/framework/user/en/installation#macos if they weren’t reviewed before.

You mentioned you added this config, any reason?

This would likely be the reason for this.

I followed the instruction, @smino and reinstalled it multiple times. The only difference between the instruction and my steps is I use a docker container for MariaDB.

@akhilnarang because I use a Macbook Identifier Case-sensitivity - MariaDB Knowledge Base

The lower_case_table_names server system variable plays a key role. It determines whether table names, aliases and database names are compared in a case-sensitive manner. If set to 0 (the default on Unix-based systems), table names and aliases and database names are compared in a case-sensitive manner. If set to 1 (the default on Windows), names are stored in lowercase and not compared in a case-sensitive manner. If set to 2 (the default on Mac OS X), names are stored as declared, but compared in lowercase.

Please try leaving it as 2, or setting it to 0.

Hi @akhilnarang

When set it to 2, the table names are:

+-------------------+
| table_name        |
+-------------------+
| tabSingles        |
| tabDefaultValue   |
| tabDocPerm        |
| __Auth            |
| tabDocType        |
| tabDocField       |
| tabSessions       |
| tabFile           |
| tabSeries         |
| tabDocType Action |
| __UserSettings    |
| __global_search   |
| tabDocType Link   |
| tabDocType State  |
+-------------------+

and, when they are compared, they are used lower case names, that’s why this error occurs:

pymysql.err.ProgrammingError: (1146, "Table 'mysite.tabdocfield' doesn't exist")

When set it to 0, then this error occurred:

[ERROR] The server option 'lower_case_table_names' is configured to use case sensitive table names but the data directory resides on a case-insensitive file system. Please use a case sensitive file system for your data directory or switch to a case-insensitive table name mode.

Hmm, the default had worked here when I tried on macOS, but I was likely on case sensitive APFS, I assume you’re on case insensitive APFS, or you have some case insensitive volume where your DB is residing.