The website breaks trying to create a Index

Created on 22 April 2025, about 1 month ago

Problem/Motivation

The DB shutsdown and the website is broken.

Steps to reproduce

Create a Database Server [OK] then try to create an index [ISSUE].

There are the logs on the DB

2025-04-22 22:26:20 
2025-04-22 22:26:20 Trying to get some variables.
2025-04-22 22:26:20 Some pointers may be invalid and cause the dump to abort.
2025-04-22 22:26:20 Query (0x7f3fe8012ef0): ALTER TABLE "search_api_db_test_index_search_api_datasource" ADD INDEX "_value" ("value" (10))
2025-04-22 22:26:20 
2025-04-22 22:26:20 Connection ID (thread ID): 50
2025-04-22 22:26:20 Status: NOT_KILLED
2025-04-22 22:26:20 
2025-04-22 22:26:20 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,hash_join_cardinality=off
2025-04-22 22:26:20 
2025-04-22 22:26:20 The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
2025-04-22 22:26:20 information that should help you find out what is causing the crash.
2025-04-22 22:26:20 Writing a core file...
2025-04-22 22:26:20 Working directory at /var/lib/mysql
2025-04-22 22:26:20 Resource Limits:
2025-04-22 22:26:20 Limit                     Soft Limit           Hard Limit           Units     
2025-04-22 22:26:20 Max cpu time              unlimited            unlimited            seconds   
2025-04-22 22:26:20 Max file size             unlimited            unlimited            bytes     
2025-04-22 22:26:20 Max data size             unlimited            unlimited            bytes     
2025-04-22 22:26:20 Max stack size            8388608              unlimited            bytes     
2025-04-22 22:26:20 Max core file size        0                    unlimited            bytes     
2025-04-22 22:26:20 Max resident set          unlimited            unlimited            bytes     
2025-04-22 22:26:20 Max processes             unlimited            unlimited            processes 
2025-04-22 22:26:20 Max open files            1048576              1048576              files     
2025-04-22 22:26:20 Max locked memory         unlimited            unlimited            bytes     
2025-04-22 22:26:20 Max address space         unlimited            unlimited            bytes     
2025-04-22 22:26:20 Max file locks            unlimited            unlimited            locks     
2025-04-22 22:26:20 Max pending signals       63399                63399                signals   
2025-04-22 22:26:20 Max msgqueue size         819200               819200               bytes     
2025-04-22 22:26:20 Max nice priority         0                    0                    
2025-04-22 22:26:20 Max realtime priority     0                    0                    
2025-04-22 22:26:20 Max realtime timeout      unlimited            unlimited            us        
2025-04-22 22:26:20 Core pattern: /mnt/wslg/dumps/core.%e
2025-04-22 22:26:20 
2025-04-22 22:26:20 Kernel version: Linux version 5.15.133.1-microsoft-standard-WSL2 (root@1c602f52c2e4) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Thu Oct 5 21:02:42 UTC 2023
2025-04-22 22:26:20 
2025-04-22 22:26:20 Fatal signal 11 while backtracing

This is what I see on the frontend side

The website encountered an unexpected error. Try again later.

( ! ) Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /var/www/html/find-care/web/core/lib/Drupal/Core/Database/StatementWrapperIterator.php:113 Stack trace: #0 /var/www/html/find-care/web/core/lib/Drupal/Core/Database/StatementWrapperIterator.php(113): PDOStatement->execute(Array) #1 /var/www/html/find-care/web/core/lib/Drupal/Core/Database/Connection.php(658): Drupal\Core\Database\StatementWrapperIterator->execute(Array, Array) #2 /var/www/html/find-care/web/core/lib/Drupal/Core/Database/Query/Select.php(520): Drupal\Core\Database\Connection->query('SELECT 1 AS "ex...', Array, Array) #3 /var/www/html/find-care/web/core/lib/Drupal/Core/Database/Query/Merge.php(366): Drupal\Core\Database\Query\Select->execute() #4 /var/www/html/find-care/web/core/lib/Drupal/Core/Session/SessionHandler.php(79): Drupal\Core\Database\Query\Merge->execute() #5 /var/www/html/find-care/web/core/lib/Drupal/Core/Session/SessionHandler.php(93): Drupal\Core\Session\SessionHandler->Drupal\Core\Session\{closure}() #6 /var/www/html/find-care/web/core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php(89): Drupal\Core\Session\SessionHandler->write(Object(SensitiveParameterValue), '_sf2_attributes...') #7 /var/www/html/find-care/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php(52): Drupal\Core\Session\WriteSafeSessionHandler->write('6r0lvi2am2aau0j...', '_sf2_attributes...') #8 [internal function]: Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->write(Object(SensitiveParameterValue), '_sf2_attributes...') #9 [internal function]: session_write_close() #10 {main} Next Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS "expression" FROM "sessions" "sessions" WHERE "sid" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => _fEUhQcR8eigk3CKNkP2pmucfdU33ty1X_aj3qbHhes ) in /var/www/html/find-care/web/core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php on line 56
( ! ) Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS "expression" FROM "sessions" "sessions" WHERE "sid" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => _fEUhQcR8eigk3CKNkP2pmucfdU33ty1X_aj3qbHhes ) in /var/www/html/find-care/web/core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php on line 56
Call Stack
#	Time	Memory	Function	Location
1	39.2941	11492880	session_write_close( )	.../Unknown:0
2	39.2941	11493136	Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->write( $sessionId = '[Sensitive Parameter]', $data = '_sf2_attributes|a:1:{s:3:"uid";s:1:"1";}_sf2_meta|a:4:{s:1:"u";i:1745365201;s:1:"c";i:1745157763;s:1:"l";i:2000000;s:1:"s";s:43:"f0-VYUOjvNP2077u63Z1TMvqzS4Xf_l0uyYEIcaPrxE";}_symfony_flashes|a:0:{}' )	.../SessionHandlerProxy.php:0
3	39.2941	11493184	Drupal\Core\Session\WriteSafeSessionHandler->write( $session_id = '6r0lvi2am2aau0jfg1b12hgelp', $session_data = '_sf2_attributes|a:1:{s:3:"uid";s:1:"1";}_sf2_meta|a:4:{s:1:"u";i:1745365201;s:1:"c";i:1745157763;s:1:"l";i:2000000;s:1:"s";s:43:"f0-VYUOjvNP2077u63Z1TMvqzS4Xf_l0uyYEIcaPrxE";}_symfony_flashes|a:0:{}' )	.../SessionHandlerProxy.php:52
4	39.2941	11493184	Drupal\Core\Session\SessionHandler->write( $sid = '[Sensitive Parameter]', $value = '_sf2_attributes|a:1:{s:3:"uid";s:1:"1";}_sf2_meta|a:4:{s:1:"u";i:1745365201;s:1:"c";i:1745157763;s:1:"l";i:2000000;s:1:"s";s:43:"f0-VYUOjvNP2077u63Z1TMvqzS4Xf_l0uyYEIcaPrxE";}_symfony_flashes|a:0:{}' )	.../WriteSafeSessionHandler.php:89
5	39.2948	11467504	Drupal\Core\Session\SessionHandler->Drupal\Core\Session\{closure:/var/www/html/find-care/web/core/lib/Drupal/Core/Session/SessionHandler.php:75-79}( )	.../SessionHandler.php:93
6	39.2948	11469744	Drupal\Core\Database\Query\Merge->execute( )	.../SessionHandler.php:79
7	39.2948	11473064	Drupal\Core\Database\Query\Select->execute( )	.../Merge.php:366
8	39.2948	11474520	Drupal\Core\Database\Connection->query( $query = 'SELECT 1 AS "expression"\nFROM\n{sessions} "sessions"\nWHERE "sid" = :db_condition_placeholder_0', $args = [':db_condition_placeholder_0' => '_fEUhQcR8eigk3CKNkP2pmucfdU33ty1X_aj3qbHhes'], $options = [] )	.../Select.php:520
9	39.2949	11415304	Drupal\mysql\Driver\Database\mysql\ExceptionHandler->handleExecutionException( $exception = class PDOException { protected $message = 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away'; private string ${Exception}string = ''; protected $code = 'HY000'; protected string $file = '/var/www/html/find-care/web/core/lib/Drupal/Core/Database/StatementWrapperIterator.php'; protected int $line = 113; private array ${Exception}trace = [0 => [...], 1 => [...], 2 => [...], 3 => [...], 4 => [...], 5 => [...], 6 => [...], 7 => [...], 8 => [...], 9 => [...]]; private ?Throwable ${Exception}previous = NULL; public ?array $errorInfo = [0 => 'HY000', 1 => 2006, 2 => 'MySQL server has gone away'] }, $statement = class Drupal\Core\Database\StatementWrapperIterator { protected object $clientStatement = class PDOStatement { public string $queryString = 'SELECT 1 AS "expression"\nFROM\n"sessions" "sessions"\nWHERE "sid" = :db_condition_placeholder_0' }; protected readonly Drupal\Core\Database\Connection $connection = class Drupal\mysql\Driver\Database\mysql\Connection { protected $target = 'default'; protected $key = 'default'; protected $logger = NULL; protected $driverClasses = [...]; protected $statementWrapperClass = 'Drupal\\Core\\Database\\StatementWrapperIterator'; protected $transactionalDDLSupport = FALSE; protected $connection = class PDO { ... }; protected $connectionOptions = [...]; protected $schema = class Drupal\mysql\Driver\Database\mysql\Schema { ... }; protected string $prefix = ''; protected array $tablePlaceholderReplacements = [...]; protected $escapedTables = [...]; protected $escapedFields = [...]; protected $escapedAliases = [...]; protected $identifierQuotes = [...]; private array ${Drupal\Core\Database\Connection}enabledEvents = [...]; protected Drupal\Core\Database\Transaction\TransactionManagerInterface $transactionManager = class Drupal\mysql\Driver\Database\mysql\TransactionManager { ... }; private $serverVersion = NULL }; protected readonly bool $rowCountEnabled = FALSE; private bool $isResultsetIterable = FALSE; private mixed $resultsetRow = NULL; private int $resultsetKey = -1; protected array $fetchModeLiterals = [0 => 'FETCH_DEFAULT', 1 => 'FETCH_LAZY', 2 => 'FETCH_ASSOC', 3 => 'FETCH_NUM', 4 => 'FETCH_BOTH', 5 => 'FETCH_OBJ', 6 => 'FETCH_BOUND', 7 => 'FETCH_COLUMN', 8 => 'FETCH_CLASS', 9 => 'FETCH_INTO', 10 => 'FETCH_FUNC', 11 => 'FETCH_NAMED', 12 => 'FETCH_KEY_PAIR', 262152 => 'FETCH_CLASS | FETCH_CLASSTYPE', 1048584 => 'FETCH_CLASS | FETCH_PROPS_LATE']; protected array $supportedFetchModes = [0 => 2, 1 => 8, 2 => 1048584, 3 => 7, 4 => 3, 5 => 5] }, $arguments = [':db_condition_placeholder_0' => '_fEUhQcR8eigk3CKNkP2pmucfdU33ty1X_aj3qbHhes'], $options = ['fetch' => 5, 'allow_delimiter_in_query' => FALSE, 'allow_square_brackets' => FALSE, 'pdo' => []] )

I tried to reset the website twice, repeat all the steps to create a simple database server and a simple index over the server. The website just breaks.

Maria DB Version: mariadb:10.8
Drupal Version: 11
Working on docker containers.

Machine name: search_api_db
Version: 8.x-1.38

I don't know what to try.

🐛 Bug report
Status

Active

Version

1.38

Component

Database backend

Created by

🇦🇹Austria donnadulcinea

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @donnadulcinea
  • 🇦🇹Austria drunken monkey Vienna, Austria

    Hi, and thanks for reporting this issue!
    However, I don’t think I’ve heard something like this before and can assure you that this works in general, of course, we have extensive test coverage to prove that. Therefore, I’m not sure what I can do here to help you, I don’t really have suggestions on what to try.
    Or, if you’re trying this on your existing site, maybe try with a bare installation of Drupal? If that works, try to change one thing at a time and see when it breaks. But a lengthy process for sure, sorry.

    Maybe someone else has run into this before and can jump in here.

  • 🇦🇹Austria donnadulcinea

    Thank you for taking the time to answer.

    Update. I succeded to solve the issue downgrading Maria DB from 10.8 to an LTS, the version 10.6.

    I put here other configurations just for sake of completeness.

    --max_allowed_packet=1G
    --innodb_buffer_pool_size=256M
    --tmp_table_size=64M
    --max_heap_table_size=64M
    --wait_timeout=600
    --connect_timeout=60

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024