Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Databases and Redis

An Aria table fails with 'Read page with wrong checksum' (error 1030, code 176)

Error#1030 - Got error 176 "Read page with wrong checksum" from storage engine Aria

Short answer

Code 176 means MariaDB's Aria engine read a data or index page whose checksum does not match, so that table file is damaged. Aria holds the mysql system tables and many temporary tables. Check the table, then repair it: REPAIR TABLE while the server runs, or aria_chk with the server stopped. Back up the files before you repair.

  • Applies to MariaDB 10.11 and 11.4 LTS, Aria tables, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Find out which table raises the error and whether it is an Aria table. The mysql schema is Aria, so a failing login or privilege lookup often points there.

    SELECT table_schema, table_name, engine
    FROM information_schema.tables
    WHERE engine = 'Aria' AND table_schema NOT IN ('information_schema');
  2. 2Match what you see, then jump to its fix

    1. 1The error repeats on one table and other tables workOne Aria table file is damagedFix
    2. 2The error is in the log at startup and no client can connectThe server cannot start or stay up, so SQL repair is not possibleFix
    3. 3The server fails at startup with a message such as Missing valid id in the aria_control_fileThe Aria control file or transaction logs are corruptFix

What does the error look like?

  • #1030 - Got error 176 "Read page with wrong checksum" from storage engine Aria
  • ERROR 1030 (HY000): Got error 176 "Read page with wrong checksum" from storage engine Aria

Cause 1 of 3

One Aria table file is damaged

1Check

Run a check on the table while the server is up. The SQL statements replace aria_chk when the server is running.

CHECK TABLE mysql.proc;

2Fix

Copy the table files first, then repair the table from SQL. REPAIR TABLE supports Aria tables; QUICK repairs only the index and leaves the data file alone.

REPAIR TABLE mysql.proc QUICK;
-- if CHECK TABLE still reports errors
REPAIR TABLE mysql.proc;

3Verify

CHECK TABLE reports status OK.

CHECK TABLE mysql.proc;

Confirmed by mariadb.com

Did this fix it?

Cause 2 of 3

The server cannot start or stay up, so SQL repair is not possible

1Check

aria_chk works on the .MAI files on disk. The server must be stopped; the docs warn that aria_chk should not be used while MariaDB is running.

sudo systemctl stop mariadb
cd /var/lib/mysql
sudo aria_chk --check mysql/*.MAI

2Fix

Repair the damaged tables with --recover, and use --safe-recover only when --recover cannot fix the data file. -B keeps a backup of the data file first.

sudo aria_chk --recover --backup mysql/proc.MAI
# only if the line above fails
sudo aria_chk --safe-recover mysql/proc.MAI

3Verify

A second check run finishes without errors, and the server starts.

sudo aria_chk --check mysql/*.MAI
sudo systemctl start mariadb

Confirmed by mariadb.com

Did this fix it?

Cause 3 of 3

The Aria control file or transaction logs are corrupt

1Check

After an unclean shutdown Aria recovers from its logs. If the control file or the aria_log files are damaged, recovery itself fails.

sudo ls -l /var/lib/mysql/aria_log_control /var/lib/mysql/aria_log.*

2Fix

With the server stopped and the files copied away, delete the control file and all aria_log files. On the next open of an Aria table the server checks and repairs it automatically. The file names can differ by version, so match the names in your data directory.

sudo systemctl stop mariadb
sudo mkdir /root/aria-logs-backup
sudo mv /var/lib/mysql/aria_log_control /var/lib/mysql/aria_log.* /root/aria-logs-backup/
sudo systemctl start mariadb

3Verify

The server starts and CHECK TABLE passes on the Aria tables.

sudo journalctl -n 30 -u mariadb.service

Confirmed by mariadb.com

Did this fix it?

How do I stop it coming back?

  • Take a backup of the data directory or a logical dump on a schedule, and test a restore.
  • Stop the server cleanly before copying or moving the data directory.
  • Watch the disk and filesystem health logs; repeated checksum errors can point at the storage under the database.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.