Skip to content

Backup stop on mysql MyISAM error tableΒ #1470

Open
@thejoe8495

Description

I found an realy bad bug. The backupscript for the database stop working when an MyISAM Table is broken. One of these 4 tables on MyISAM: help, tabData Import, tabError Log, __global_search

In my case the __global_search was broken and i need to fix it with mysqlcheck. I tried to reinstall an erpnext on a new server i became the error "tabDefaultValue" not found. After this i insert the dump in the database, then i became the error pymysql.err.ProgrammingError: ('DocType', 'DocType') after some long search i thinked i make an mysqldump. And then i found the problem:
mysqldump: Error 1194: Table '__global_search' is marked as crashed and should be repaired when dumping table '__global_search' at row: 304017
I can fix it with mysqlcheck -u <dbname or root> -p --repair <dbname> after this i can make my backup with mysqldump

After this i checked my personal server and there is the same problem. My database has 400mb data and the file is 7mb, so the latest version has this error too.

Do the checklist before filing an issue:

  • Can you replicate the issue on the supported bench versions?
  • Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome

Describe the bug πŸ“‰
The tables of MyISAM has an error, bench dont see it and stop at this table. Linux show the message of the table who is damaged.

To Reproduce πŸ“ƒ
Sorry i have no idea how i can destroy a table.

Expected behavior πŸ“ˆ
throw an error in errorlog or send an e-mail

OS (please complete the following information): πŸŒ€

  • Linux: Debian 10.2.1-6

Version Information

Can be found out by running bench version in your respective bench folder.

  • Bench Branch: 5.16.2
  • Frappe Version: v14.40.1
  • ERPNext Version: v14.28.0

Possible Solution πŸ“‘

  • change the last 4 tables to InnoDB on the next upgrade
  • run an mysql check
    CHECK TABLE <database>.__global_search;
    CHECK TABLE <database>.help;
    CHECK TABLE <database>.tabData Import Log;
    CHECK TABLE <database>.tabError Log;
    CHECK TABLE <database>.__global_search;
  • make the same importcheck after finish backup

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions