cPanel error Bad magic header in tc log | Resolved

Home > cPanel error Bad magic header in tc log | Resolved

cPanel error Bad magic header in tc log workaround from the experts at Bobcares.

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team recently helped a customer by resolving the “Bad magic header in tc log” cPanel error.

How to resolve cPanel error: “Bad magic header in tc log”?

Have you been coming across the following error while attempting to restart MySQL:

[ERROR] Bad magic header in tc log
[ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
[ERROR] Can't init tc log
[ERROR] Aborting

According to our Support Team, this error indicates that the transaction coordinator log is corrupt. In order to recover from this issue, we have to delete the tc.log file. Then, we have to restart the server with the help of the  –tc-heuristic-recover option set.

We can run the following coming as via the WHM terminal or SSH to accomplish this:

mv -vi /var/lib/mysql/tc.log /root

Furthermore, this error often occurs while using docker. If so, the error may be a result of the using MariaDB container version with a data directory from a different MySQL or MariaDB version. So some potential strategies to fix this error from occurring include:

  • Pinning the docker instance to the specific version of MariaDB in the docker-compose file.
  • Running mysql_upgrade command to make sure that data directory is upgraded to the server version.

[Looking for assistance with another query? We are just a click away.]


In brief, the skilled Support Engineers at Bobcares demonstrated how to resolve the “Bad magic header in tc log” error. We also learned how to ensure the error does not pop up again.


Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.