【以下均可删除】
提问前请务必仔细阅读 如何排查故障 和 常见问题。
问题描述(报错内容):
我在本地尝试使用Podman搭建Flarum,但是遇上了Flarum执行安装时MariaDB崩溃Bug,我该怎么解决这个问题?
mysql-1 | 2024-05-09 3:36:57 0 [Note] mariadbd (server 10.6.5-MariaDB-1:10.6.5+maria~focal) starting as process 1 ...
mysql-1 | 2024-05-09 3:36:57 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
mysql-1 | 2024-05-09 3:36:57 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mysql-1 | 2024-05-09 3:36:57 0 [Note] InnoDB: Number of pools: 1
mysql-1 | 2024-05-09 3:36:57 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
mysql-1 | 2024-05-09 3:36:57 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
mysql-1 | 2024-05-09 3:36:57 0 [Note] InnoDB: Using Linux native AIO
mysql-1 | 2024-05-09 3:36:57 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
mysql-1 | 2024-05-09 3:36:57 0 [Note] InnoDB: Completed initialization of buffer pool
mysql-1 | 2024-05-09 3:36:58 0 [Note] InnoDB: 128 rollback segments are active.
mysql-1 | 2024-05-09 3:36:58 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mysql-1 | 2024-05-09 3:36:58 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
php-1 | 10.89.1.1 - - [09/May/2024:03:36:51 +0000] "GET / HTTP/1.1" 200 4440 "http://localhost:8006/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0"
mysql-1 | 2024-05-09 3:37:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mysql-1 | 2024-05-09 3:37:00 0 [Note] InnoDB: 10.6.5 started; log sequence number 42173; transaction id 14
mysql-1 | 2024-05-09 3:37:00 0 [Note] Plugin 'FEEDBACK' is disabled.
mysql-1 | 2024-05-09 3:37:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mysql-1 | 2024-05-09 3:37:00 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
mysql-1 | 2024-05-09 3:37:00 0 [Note] InnoDB: Buffer pool(s) load completed at 240509 3:37:00
mysql-1 | 2024-05-09 3:37:00 0 [Note] Server socket created on IP: '0.0.0.0'.
mysql-1 | 2024-05-09 3:37:00 0 [Note] Server socket created on IP: '::'.
mysql-1 | 2024-05-09 3:37:00 0 [Warning] 'proxies_priv' entry '@% root@075caac83410' ignored in --skip-name-resolve mode.
mysql-1 | 2024-05-09 3:37:00 0 [Note] mariadbd: ready for connections.
mysql-1 | Version: '10.6.5-MariaDB-1:10.6.5+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
php-1 | 10.89.1.1 - - [09/May/2024:03:36:59 +0000] "GET /favicon.ico HTTP/1.1" 200 4450 "http://localhost:8006/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0"
mysql-1 | 2024-05-09 3:37:58 3 [ERROR] InnoDB: preallocating 147456 bytes for file ./flarum/flarum_flags.ibd failed with error 2
mysql-1 | 2024-05-09 03:37:58 0x7fda78234700 InnoDB: Assertion failure in file /home/buildbot/buildbot/build/mariadb-10.6.5/storage/innobase/fil/fil0fil.cc line 608
mysql-1 | InnoDB: Failing assertion: fsize != os_offset_t(-1)
mysql-1 | InnoDB: We intentionally generate a memory trap.
mysql-1 | InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
mysql-1 | InnoDB: If you get repeated assertion failures or crashes, even
mysql-1 | InnoDB: immediately after the mariadbd startup, there may be
mysql-1 | InnoDB: corruption in the InnoDB tablespace. Please refer to
mysql-1 | InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
mysql-1 | InnoDB: about forcing recovery.
mysql-1 | 240509 3:37:58 [ERROR] mysqld got signal 6 ;
mysql-1 | This could be because you hit a bug. It is also possible that this binary
mysql-1 | or one of the libraries it was linked against is corrupt, improperly built,
mysql-1 | or misconfigured. This error can also be caused by malfunctioning hardware.
mysql-1 |
mysql-1 | To report this bug, see https://mariadb.com/kb/en/reporting-bugs
mysql-1 |
mysql-1 | We will try our best to scrape up some info that will hopefully help
mysql-1 | diagnose the problem, but since we have already crashed,
mysql-1 | something is definitely wrong and this may fail.
mysql-1 |
mysql-1 | Server version: 10.6.5-MariaDB-1:10.6.5+maria~focal
mysql-1 | key_buffer_size=134217728
mysql-1 | read_buffer_size=131072
mysql-1 | max_used_connections=1
mysql-1 | max_threads=153
mysql-1 | thread_count=1
mysql-1 | It is possible that mysqld could use up to
mysql-1 | key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467957 K bytes of memory
mysql-1 | Hope that's ok; if not, decrease some variables in the equation.
mysql-1 |
mysql-1 | Thread pointer: 0x7fda18000c58
mysql-1 | Attempting backtrace. You can use the following information to find out
mysql-1 | where mysqld died. If you see no messages after this, something went
mysql-1 | terribly wrong...
mysql-1 | stack_bottom = 0x7fda78233d98 thread_stack 0x49000
mysql-1 | Printing to addr2line failed
mysql-1 | mariadbd(my_print_stacktrace+0x32)[0x560516406442]
mysql-1 | mariadbd(handle_fatal_signal+0x485)[0x560515eb96a5]
mysql-1 | /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fda7aae43c0]
mysql-1 | /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7fda7a5ea18b]
mysql-1 | /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7fda7a5c9859]
mysql-1 | mariadbd(+0x65882e)[0x560515b5582e]
mysql-1 | mariadbd(+0x6690cb)[0x560515b660cb]
mysql-1 | mariadbd(+0x669377)[0x560515b66377]
mysql-1 | mariadbd(+0x66c381)[0x560515b69381]
mysql-1 | mariadbd(+0xe523bb)[0x56051634f3bb]
mysql-1 | mariadbd(+0xdc2ed4)[0x5605162bfed4]
mysql-1 | mariadbd(+0xe11c71)[0x56051630ec71]
mysql-1 | mariadbd(+0xe1261b)[0x56051630f61b]
mysql-1 | mariadbd(+0xd34bf8)[0x560516231bf8]
mysql-1 | mariadbd(+0xcbdd8e)[0x5605161bad8e]
mysql-1 | mariadbd(+0xcc61dc)[0x5605161c31dc]
mysql-1 | mariadbd(+0xccb1ef)[0x5605161c81ef]
mysql-1 | mariadbd(+0x82c7dd)[0x560515d297dd]
mysql-1 | mariadbd(_Z17mysql_alter_tableP3THDPK25st_mysql_const_lex_stringS3_P14HA_CREATE_INFOP10TABLE_LISTP10Alter_infojP8st_orderbb+0x56c0)[0x560515d38e80]
mysql-1 | mariadbd(_ZN19Sql_cmd_alter_table7executeEP3THD+0x3d7)[0x560515da0f87]
mysql-1 | mariadbd(_Z21mysql_execute_commandP3THDb+0x1116)[0x560515c8de66]
mysql-1 | mariadbd(_ZN18Prepared_statement7executeEP6Stringb+0x4aa)[0x560515ca1e0a]
mysql-1 | mariadbd(_ZN18Prepared_statement12execute_loopEP6StringbPhS2_+0x89)[0x560515ca2019]
mysql-1 | mariadbd(+0x7a5ec5)[0x560515ca2ec5]
mysql-1 | mariadbd(_Z19mysqld_stmt_executeP3THDPcj+0x30)[0x560515ca30a0]
mysql-1 | mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjb+0x1d4b)[0x560515c8aa8b]
mysql-1 | mariadbd(_Z10do_commandP3THDb+0x138)[0x560515c8bfe8]
mysql-1 | mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x3b7)[0x560515d9c147]
mysql-1 | mariadbd(handle_one_connection+0x5d)[0x560515d9c49d]
mysql-1 | mariadbd(+0xbfe9cd)[0x5605160fb9cd]
mysql-1 | /lib/x86_64-linux-gnu/libpthread.so.0(+0x9609)[0x7fda7aad8609]
mysql-1 | /lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7fda7a6c6293]
mysql-1 |
mysql-1 | Trying to get some variables.
mysql-1 | Some pointers may be invalid and cause the dump to abort.
mysql-1 | Query (0x7fda1801a9e0): alter table `flarum_flags` add index `flarum_flags_created_at_index`(`created_at`)
mysql-1 |
mysql-1 | Connection ID (thread ID): 3
mysql-1 | Status: NOT_KILLED
mysql-1 |
mysql-1 | Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
mysql-1 |
mysql-1 | The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
mysql-1 | information that should help you find out what is causing the crash.
mysql-1 | Writing a core file...
mysql-1 | Working directory at /var/lib/mysql
mysql-1 | Resource Limits:
mysql-1 | Limit Soft Limit Hard Limit Units
mysql-1 | Max cpu time unlimited unlimited seconds
mysql-1 | Max file size unlimited unlimited bytes
mysql-1 | Max data size unlimited unlimited bytes
mysql-1 | Max stack size 8388608 unlimited bytes
mysql-1 | Max core file size unlimited unlimited bytes
mysql-1 | Max resident set unlimited unlimited bytes
mysql-1 | Max processes 32768 32768 processes
mysql-1 | Max open files 1048576 1048576 files
mysql-1 | Max locked memory 67108864 67108864 bytes
mysql-1 | Max address space unlimited unlimited bytes
mysql-1 | Max file locks unlimited unlimited locks
mysql-1 | Max pending signals 11229 11229 signals
mysql-1 | Max msgqueue size 819200 819200 bytes
mysql-1 | Max nice priority 0 0
mysql-1 | Max realtime priority 0 0
mysql-1 | Max realtime timeout unlimited unlimited us
mysql-1 | Core pattern: /mnt/wslg/dumps/core.%e
mysql-1 |
mysql-1 | Fatal signal 11 while backtracing
mysql-1 exited with code 139
运行环境:
- WSL
- Podman + PHP + Apache + MariaDB
已尝试的解决办法(演示网址或图片):
- 切换MariaDB版本
- 向智谱轻言求助,获得如下答复:
从您提供的日志信息来看,MariaDB 服务器在启动时遇到了一个问题,导致其崩溃。错误信息提到了一个关于 InnoDB 表空间预分配的问题,这个问题导致服务器在处理表时发生了断言失败。
具体来说,错误信息指出在尝试为表 `flarum_flags` 预分配文件 `flarum_flags.ibd` 时失败,并且服务器随后崩溃。这通常与磁盘空间不足、文件系统问题或其他文件系统限制有关。
解决这个问题的步骤可能包括:
1. **检查磁盘空间**:确保 `/var/lib/mysql` 目录有足够的空间。您可以使用 `df -h` 命令来检查磁盘空间。
2. **检查文件系统**:确保 `/var/lib/mysql` 目录所在的文件系统没有问题。您可以使用 `fsck` 命令来检查文件系统的完整性。
3. **重启 MariaDB 服务**:尝试重启 MariaDB 服务,看问题是否解决。
4. **手动创建表空间文件**:如果 `flarum_flags.ibd` 文件不存在,您可以尝试手动创建它,然后重启 MariaDB 服务。
5. **查看完整堆栈跟踪**:为了进一步诊断问题,您可能需要查看完整的堆栈跟踪。这通常需要使用 `gdb` 调试器。
6. **提交问题报告**:如果您无法解决问题,建议您提交一个详细的问题报告到 MariaDB 的 Jira 问题跟踪系统,并提供完整的堆栈跟踪和环境信息。
如果您需要进一步的帮助来解决这个具体的问题,请提供更多的上下文信息,比如您是如何启动 MariaDB 服务的,以及 `/var/lib/mysql` 目录的空间情况。