Problem/Motivation

by installing sdx i get:

 [success] Successfully uninstalled: sdx, sdx_vite, sdx_devel, sdx_react, sdx_npm
bash-5.1$ php -d memory_limit=1G ./vendor/bin/drush.php pm:install sdx

In ExceptionHandler.php line 89:

  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 F
  ROM information_schema.tables WHERE ("table_schema" = :db_condition_placeho
  lder_9) AND ("table_name" = :db_condition_placeholder_10) AND ("table_type"
   = :db_condition_placeholder_11); Array
  (
      [:db_condition_placeholder_9] => xxx_drupal_xxx
      [:db_condition_placeholder_10] => a_config
      [:db_condition_placeholder_11] => BASE TABLE
  )


In PdoTrait.php line 109:

  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away


bash-5.1$ php -d memory_limit=1G ./vendor/bin/drush.php pm:install sdx
 [notice] Already installed: sdx
bash-5.1$ php -d memory_limit=1G ./vendor/bin/drush.php sdx:resolve

In ExceptionHandler.php line 89:

  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INT
  O "a_cache_bootstrap" ("cid", "expire", "created", "tags", "checksum", "dat
  a", "serialized") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_
  1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placehold
  er_4, :db_insert_placeholder_5, :db_insert_placeholder_6) ON DUPLICATE KEY
  UPDATE "expire" = VALUES("expire"), "created" = VALUES("created"), "tags" =
   VALUES("tags"), "checksum" = VALUES("checksum"), "data" = VALUES("data"),
  "serialized" = VALUES("serialized"); Array
  (
      [:db_insert_placeholder_0] => hook_data
      [:db_insert_placeholder_1] => -1
      [:db_insert_placeholder_2] => 1786308556.112
      [:db_insert_placeholder_3] =>
      [:db_insert_placeholder_4] => 0
      [:db_insert_placeholder_5] => a:0:{}
      [:db_insert_placeholder_6] => 1
  )


In PdoTrait.php line 109:

  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#8 error.PNG90.04 KBlblabr
#8 Unbenannt.PNG42.96 KBlblabr

Comments

lblabr created an issue. See original summary.

lblabr’s picture

using drush i always get these database things. that not happend before ... (with other modules)

drupal 11.4.5

vzsigmond’s picture

Fixed in 1.0.0-alpha13 (with the first half already in 1.0.0-alpha12) - please update and confirm.

What was wrong, in your terms:

1. "by installing sdx i get [gone away]": installing/uninstalling SDX modules used to re-resolve the whole npm dependency graph against registry.npmjs.org inside pm:install - minutes of serial network I/O during which the idle MySQL connection exceeded your host's wait_timeout and died. As of alpha13 the install path does zero network - resolution only happens in drush sdx:resolve - so this cannot occur anymore. Module installs even work fully offline now.

2. "sdx:resolve [gone away]": two phases were at fault. The npm install child process is covered since alpha12 (the connection is kept alive while it runs), and as of alpha13 the registry-resolution phase fetches concurrently and caches to the database as responses arrive, so the connection stays active there too - plus the whole phase drops from minutes to seconds.

The leftover errors you saw on retries ("already an existing entry hook_data", drush en failing) were debris of the dead connection - run drush cr once after updating and they're gone. After updating, run drush sdx:resolve once; the status report now has an "SDX: Dependency lockfile" row that tells you when that's needed.

lblabr’s picture

update to -alpha13

drush en sdx works now.
drush sdx:resolve runs some minutes without showing somthing on the shell

after a while a lot database output is shown (in log 15,5MB)

starting with:

In ExceptionHandler.php line 89:

  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INT  
  O "a_cache_default" ("cid", "expire", "created", "tags", "checksum", "data"  
  , "serialized") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1,  
   :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder  
  _4, :db_insert_placeholder_5, :db_insert_placeholder_6) ON DUPLICATE KEY UP  
  DATE "expire" = VALUES("expire"), "created" = VALUES("created"), "tags" = V  
  ALUES("tags"), "checksum" = VALUES("checksum"), "data" = VALUES("data"), "s  
  erialized" = VALUES("serialized"); Array                                     
  (                                                                            
      [:db_insert_placeholder_0] => sdx:npm:package:@types/node                
      [:db_insert_placeholder_1] => 1786362596                                 
      [:db_insert_placeholder_2] => 1786340996.952                             
      [:db_insert_placeholder_3] =>                                            
      [:db_insert_placeholder_4] => 0                                          
      [:db_insert_placeholder_5] => a:15:{s:3:"_id";s:11:"@types/node";s:4:"_  
  rev";s:38:"13804-e71f5668cba94a4a03575b0db8d92a69";s:4:"name";s:11:"@types/  
  node";s:9:"dist-tags";a:42:{s:5:"ts2.7";s:7:"12.12.6";s:5:"ts2.5";s:7:"12.1  
  2.6";s:5:"ts2.2";s:7:"12.12.6";s:5:"ts2.4";s:7:"12.12.6";s:5:"ts2.3";s:7:"1  
  2.12.6";s:5:"ts2.1";s:7:"12.12.6";s:5:"ts2.0";s:7:"12.12.6";s:5:"ts2.6";s:7  
  :"12.12.6";s:5:"ts2.8";s:7:"13.13.4";s:5:"ts2.9";s:6:"14.0.1";s:5:"ts3.0";s  
  :6:"14.6.0";s:5:"ts3.1";s:7:"14.10.1";s:5:"ts3.2";s:7:"14.14.9";s:5:"ts3.3"  
  ;s:8:"14.14.20";s:5:"ts3.4";s:8:"14.14.31";s:5:"ts3.5";s:6:"15.6.1";s:5:"ts  
  3.6";s:6:"16.6.2";s:5:"ts3.7";s:7:"16.11.7";s:5:"ts3.8";s:7:"17.0.21";s:5:"  
  ts3.9";s:7:"17.0.41";s:5:"ts4.0";s:7:"18.7.14";s:5:"ts4.1";s:7:"18.11.9";s:  
  5:"ts4.2";s:7:"18.15.3";s:5:"ts4.3";s:6:"20.6.0";s:5:"ts4.4";s:6:"20.6.0";s  
  :5:"ts4.5";s:7:"20.10.0";s:5:"ts4.6";s:8:"20.11.25";s:5:"ts4.7";s:7:"20.14.  
  8";s:5:"ts4.8";s:6:"22.9.0";s:5:"ts4.9";s:6:"22.9.3";s:5:"ts5.0";s:8:"22.13  
  .14";s:5:"ts5.1";s:6:"24.1.0";s:5:"ts5.2";s:6:"25.5.0";s:5:"ts5.5";s:6:"25.  
  9.3";s:5:"ts5.3";s:6:"25.9.3";s:5:"ts5.4";s:6:"25.9.3";s:5:"ts5.9";s:6:"26.  
  2.0";s:5:"ts5.6";s:6:"26.2.0";s:5:"ts6.0";s:6:"26.2.0";s:6:"latest";s:6:"26  
  .2.0";s:5:"ts5.7";s:6:"26.2.0";s:5:"ts5.8";s:6:"26.2.0";}s:8:"versions";a:2  
  356:{s:12:"4.0.15-alpha";a:20:{s:4:"name";s:11:"@types/node";s:7:"version";  
  s:12:"4.0.15-alpha";s:6:"author";a:2:{s:4:"name";s:20:"Microsoft TypeScript  
  ";s:5:"email";s:25:"http://typescriptlang.org";}s:7:"license";s:3:"MIT";s:3  
  :"_id";s:24:"@types/node@4.0.15-alpha";s:11:"maintainers";a:1:{i:0;a:2:{s:4  
  :"name";s:5:"types";s:5:"email";s:28:"ryan.cavanaugh@microsoft.com";}}s:4:"  

and end up with:

  migradsky";s:4:"name";s:18:"Dmitry Semigradsky";s:14:"githubUsername";s:11:  
  "Semigradsky";}i:22;a:3:{s:3:"url";s:30:"https://github.com/Renegade334";s:  
  4:"name";s:5:"René";s:14:"githubUsername";s:11:"Renegade334";}i:23;a:3:{s:3  
  :"url";s:26:"https://github.com/anonrig";s:4:"name";s:13:"Yagiz Nizipli";s:  
  14:"githubUsername";s:7:"anonrig";}}s:11:"maintainers";a:1:{i:0;a:2:{s:4:"n  
  ame";s:5:"types";s:5:"email";s:26:"ts-npm-types@microsoft.com";}}s:6:"readm  
  e";s:1582:"# Installation                                                    
  > `npm install --save @types/node`                                           
                                                                               
  # Summary                                                                    
  This package contains type definitions for node (https://nodejs.org/).       
                                                                               
  # Details                                                                    
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped  
  /tree/master/types/node.                                                     
                                                                               
  ### Additional Details                                                       
   * Last updated: Fri, 07 Aug 2026 17:46:44 GMT                               
   * Dependencies: [undici-types](https://npmjs.com/package/undici-types)      
                                                                               
  # Credits                                                                    
  These definitions were written by [Microsoft TypeScript](https://github.com  
  /Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makaro  
  v](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg),   
  [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.co  
  m/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silberma  
  nn](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBak  
  ker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https:  
  //github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia B  
  aryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-  
  Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henn  
  ingsen](https://github.com/addaleax), [Victor Perin](https://github.com/vic  
  torperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäc  
  k](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13),  
   [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https:  
  //github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yag  
  iz Nizipli](https://github.com/anonrig).                                     
  ";s:14:"readmeFilename";s:0:"";s:5:"users";a:25:{s:4:"dntx";b:1;s:4:"tido";  
  b:1;s:6:"mrbgit";b:1;s:6:"olonam";b:1;s:6:"satoru";b:1;s:7:"abetomo";b:1;s:  
  7:"dkocich";b:1;s:8:"ctaggart";b:1;s:8:"shaddyhm";b:1;s:8:"tdmalone";b:1;s:  
  8:"yang_xin";b:1;s:9:"azertypow";b:1;s:9:"dumplings";b:1;s:9:"dunstontc";b:  
  1;s:9:"pepperpot";b:1;s:9:"redstrike";b:1;s:9:"stephanlv";b:1;s:9:"wolfram7  
  7";b:1;s:10:"mgthomas99";b:1;s:10:"morogasper";b:1;s:10:"supercocoa";b:1;s:  
  11:"flumpus-dev";b:1;s:12:"hugojosefson";b:1;s:12:"jackie-lueng";b:1;s:12:"  
  joshdoescode";b:1;}}                                                         
      [:db_insert_placeholder_6] => 1                                          
  )                                                                            
                                                                               

In PdoTrait.php line 109:
                                                                   
  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away  
vzsigmond’s picture

Thanks for the fast retest - that log dump was exactly what was needed. This was a different failure than the previous ones despite the same error code: MySQL also reports "server has gone away" when a single INSERT exceeds max_allowed_packet, and alpha13's resolver cached the full registry document per package - @types/node is over 15 MB serialized, which your host's packet limit rejected, killing the connection.

Fixed in 1.0.0-alpha14: SDX now fetches npm's abbreviated document format (the same one npm/pnpm use) and caches only the fields the resolver reads - @types/node drops from >15 MB to ~550 KB, resolves in a fraction of a second, and the minutes of silent downloading are gone. You should also no longer need the raised memory_limit for sdx:resolve. Please update and confirm.

lblabr’s picture

SDX Doctor
==========

----------- ------------------ ------------------------------------------------------------------------------------- -----------------------------------------------------------------------------
  Status      Check              Result                                                                                Fix / Suggestion
 ----------- ------------------ ------------------------------------------------------------------------------------- -----------------------------------------------------------------------------
  ✓ OK        Node.js            v26.7.0
  ✓ OK        Build directory    ./sites/default/files/private/sdx
  ⚠ Warning   SDX components     None found                                                                            Create components under a components/ directory with a .component.yml file.
  ✓ OK        Built assets       0 file(s) in 1 framework(s)
  ✓ OK        sdx_npm            Enabled                                                                               Provides npm package manager.
  ✗ Error     Framework module   None enabled                                                                          Enable a framework: drush en sdx_react or drush en sdx_vue
  ✗ Error     Bundler module     None enabled                                                                          Enable a bundler: drush en sdx_vite
 ----------- ------------------ ------------------------------------------------------------------------------------- -----------------------------------------------------------------------------

bash-5.1$ php -d memory_limit=1G ./vendor/bin/drush.php sdx:build

  ⚡ SDX Build

  JS Components
  ⚠ 0 library assets compiled, 5 failed
    *: esbuild is not installed under SDX node_modules. esbuild is declared as a build-time dependency in sdx_vite.sdx.yml and lands in the resolved sdx.lock alongside every other build/runtime dep. If a CI/CD pipeline skipped or partially ran the install, rerun `drush sdx:resolve` before the build phase to materialise the workspace.
 [error]  Failed to build framework react: The command "'npm' 'install' '--no-audit' '--no-fund'" failed.

Exit Code: 1(General error)

Working directory: xxxxx/sites/default/files/private/sdx/build-configs/react/vite

Output:
================


Error Output:
================
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: sdx-react-build@1.0.0
npm error Found: vite@7.3.6
npm error node_modules/vite
npm error   dev vite@"^7.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer vite@"^8.0.0" from @vitejs/plugin-react@6.0.5
npm error node_modules/@vitejs/plugin-react
npm error   dev @vitejs/plugin-react@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /.npm/_logs/2026-08-10T07_22_13_010Z-eresolve-report.txt
npm error A complete log of this run can be found in: /.npm/_logs/2026-08-10T07_22_13_010Z-debug-0.log

  ✗ react (6.1s)
    The command "'npm' 'install' '--no-audit' '--no-fund'" failed.

Exit Code: 1(General error)

Working directory: xxx/sites/default/files/private/sdx/build-configs/react/vite

Output:
================


Error Output:
================
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: sdx-react-build@1.0.0
npm error Found: vite@7.3.6
npm error node_modules/vite
npm error   dev vite@"^7.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer vite@"^8.0.0" from @vitejs/plugin-react@6.0.5
npm error node_modules/@vitejs/plugin-react
npm error   dev @vitejs/plugin-react@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /.npm/_logs/2026-08-10T07_22_13_010Z-eresolve-report.txt
npm error A complete log of this run can be found in: /.npm/_logs/2026-08-10T07_22_13_010Z-debug-0.log
vzsigmond’s picture

Great, this output confirms the database bug is fixed.

What you're seeing now is separate, and the sdx:doctor output shows the cause: no framework module and no bundler module are enabled. The build ran against a leftover build-config dir from before, and without sdx_react enabled its vite plugin has no pinned version in sdx.lock - so npm fetched the newest @vitejs/plugin-react (6.x, which wants vite 8) and hit the peer conflict. To get going:

  drush en sdx_react sdx_vite -y
  drush sdx:resolve
  drush sdx:build

That said, you've exposed two things we'll harden regardless: the build will stop emitting unpinned ("*") dependencies into the generated package.json (it will fail with an actionable message instead), and sdx:build will skip stale build configs for frameworks whose module isn't enabled.

Thanks for the thorough reports!

lblabr’s picture

StatusFileSize
new42.96 KB
new90.04 KB

looks fine now. i need to solve the base_dir error

lblabr’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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