XF 2.3 MySQL keeps crashing?

Myke623

Well-known member
Attempting to do a test upgrade from XF 1.5 to 2.3 on my local development environment and I'm encountering an issue with MySQL crashing.

My server environment:
1737605451221.webp
Image taken from a stock (full) install of XF 2.3 within the same environment, which installed successfully.

The initial part of the installation that progresses from XF 2.0.0 and onward seems to have run successfully, but when I get to (final?) step to upgrade to 2.3.4:

1737605095860.webp

Upon clicking the Begin upgrade button, after a while the MySQL server crashes with the browser reporting the following:

An exception occurred: [XF\Db\Exception] MySQL statement prepare error [2006]: MySQL server has gone away in src\XF\Db\AbstractStatement.php on line 230

1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 207
2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 43
3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 61
4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 96
5. XF\Db\AbstractAdapter->query() in src/XF/Session/DbStorage.php at line 48
6. XF\Session\DbStorage->writeSession() in src/XF/Session/Session.php at line 223
7. XF\Session\Session->save() in src/XF/Install/App.php at line 229
8. XF\Install\App->complete() in src/XF/App.php at line 2829
9. XF\App->run() in src/XF.php at line 806
10. XF::runApp() in install/index.php at line 16

and the mysqld.log file shows the following:

Code:
2025-01-23T03:55:20.247893Z 16 [ERROR] [MY-012611] [InnoDB] Operating system error number 32 in a file operation.
2025-01-23T03:55:20.248369Z 16 [ERROR] [MY-012615] [InnoDB] The error means that another program is using InnoDB's files. This might be a backup or antivirus software or another instance of MySQL. Please close it to get rid of this error.
InnoDB: ###### Diagnostic info printed to the standard error stream
2025-01-23T03:55:21.998187Z 0 [ERROR] [MY-012872] [InnoDB] [FATAL] Semaphore wait has lasted > 600 seconds. We intentionally crash the server because it appears to be hung.
2025-01-23T03:55:21.999420Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: srv0srv.cc:1882:ib::fatal triggered thread 35044
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.4/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
2025-01-23T03:55:21Z UTC - mysqld got exception 0x16 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
7ff7b961d988    mysqld.exe!?my_print_stacktrace@@YAXPEBEK@Z()
7ff7b87db991    mysqld.exe!?my_server_abort@@YAXXZ()
7ff7b87db6d3    mysqld.exe!?my_server_abort@@YAXXZ()
7ff7b960826a    mysqld.exe!?my_abort@@YAXXZ()
7ff7b97db359    mysqld.exe!?zstd_mem_res_free@Zstd_dec@compression@event@binlog@mysql@@CAXPEAX0@Z()
7ff7b9730413    mysqld.exe!?zstd_mem_res_free@Zstd_dec@compression@event@binlog@mysql@@CAXPEAX0@Z()
7ff7b96e8006    mysqld.exe!?zstd_mem_res_free@Zstd_dec@compression@event@binlog@mysql@@CAXPEAX0@Z()
7ff7b969777e    mysqld.exe!?zstd_mem_res_free@Zstd_dec@compression@event@binlog@mysql@@CAXPEAX0@Z()
7ff7b9697bc5    mysqld.exe!?zstd_mem_res_free@Zstd_dec@compression@event@binlog@mysql@@CAXPEAX0@Z()
7ffe554b1bb2    ucrtbase.dll!_configthreadlocale()
7ffe56a97374    KERNEL32.DLL!BaseThreadInitThunk()
7ffe5791cc91    ntdll.dll!RtlUserThreadStart()
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

Any help on how to resolve this would be greatly appreciated!
 
Solution
Just to close the loop, turns out that my xf_ip table had grown enormously large (almost 1 million records) to the detriment of my poor old development environment trying to do anything with the table. After truncating it, I was able to proceed with the migration from 1.5 without any major issue.

I have since enabled the logging feature to only keep a year's worth of IP data in the ACP.
Just to close the loop, turns out that my xf_ip table had grown enormously large (almost 1 million records) to the detriment of my poor old development environment trying to do anything with the table. After truncating it, I was able to proceed with the migration from 1.5 without any major issue.

I have since enabled the logging feature to only keep a year's worth of IP data in the ACP.
 
Solution
I had the same issue myself--not with an upgrade, but while trying to do something else with XF 1.5 and the database. The xf_ip table was enormous as we kept a history of IP addresses back to 2012, and we've grown from about 100k post a month to 200k. I now have it set for a much shorter time period. I'm not sure if it's set to one year or three years, but having more history helped us detect banned members trying to rejoin.
 
Back
Top Bottom