Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column

Created on 8 January 2024, 10 months ago
Updated 16 July 2024, 4 months ago

Hello,

I've a SQL error with a data to add into a menu. I don't know if the error is from Drupal core Menu module or Facets module.
Data string from db_update_placeholder_28 is to big to field and I don't see why.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'route_param_key' at row 1: UPDATE "menu_tree" SET "menu_name"=:db_update_placeholder_0, "route_name"=:db_update_placeholder_1, "route_parameters"=:db_update_placeholder_2, "url"=:db_update_placeholder_3, "title"=:db_update_placeholder_4, "description"=:db_update_placeholder_5, "parent"=:db_update_placeholder_6, "weight"=:db_update_placeholder_7, "options"=:db_update_placeholder_8, "expanded"=:db_update_placeholder_9, "enabled"=:db_update_placeholder_10, "provider"=:db_update_placeholder_11, "metadata"=:db_update_placeholder_12, "class"=:db_update_placeholder_13, "form_class"=:db_update_placeholder_14, "id"=:db_update_placeholder_15, "discovered"=:db_update_placeholder_16, "has_children"=:db_update_placeholder_17, "depth"=:db_update_placeholder_18, "p1"=:db_update_placeholder_19, "p2"=:db_update_placeholder_20, "p3"=:db_update_placeholder_21, "p4"=:db_update_placeholder_22, "p5"=:db_update_placeholder_23, "p6"=:db_update_placeholder_24, "p7"=:db_update_placeholder_25, "p8"=:db_update_placeholder_26, "p9"=:db_update_placeholder_27, "route_param_key"=:db_update_placeholder_28 WHERE "mlid" = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => main-menu [:db_update_placeholder_1] => view.product_catalog.page_product_catalog [:db_update_placeholder_2] => a:43:{s:12:"facets_query";s:0:"";s:2:"f0";s:0:"";s:2:"f1";s:0:"";s:2:"f2";s:0:"";s:2:"f3";s:0:"";s:2:"f4";s:0:"";s:2:"f5";s:0:"";s:2:"f6";s:0:"";s:2:"f7";s:0:"";s:2:"f8";s:0:"";s:2:"f9";s:0:"";s:3:"f10";s:0:"";s:3:"f11";s:0:"";s:3:"f12";s:0:"";s:3:"f13";s:0:"";s:3:"f14";s:0:"";s:3:"f15";s:0:"";s:3:"f16";s:0:"";s:3:"f17";s:0:"";s:3:"f18";s:0:"";s:3:"f19";s:0:"";s:3:"f20";s:0:"";s:3:"f21";s:0:"";s:3:"f22";s:0:"";s:3:"f23";s:0:"";s:3:"f24";s:0:"";s:3:"f25";s:0:"";s:3:"f26";s:0:"";s:3:"f27";s:0:"";s:3:"f28";s:0:"";s:3:"f29";s:0:"";s:3:"f30";s:0:"";s:3:"f31";s:0:"";s:3:"f32";s:0:"";s:3:"f33";s:0:"";s:3:"f34";s:0:"";s:3:"f35";s:0:"";s:3:"f36";s:0:"";s:3:"f37";s:0:"";s:3:"f38";s:0:"";s:3:"f39";s:0:"";s:10:"display_id";s:20:"page_product_catalog";s:7:"view_id";s:15:"product_catalog";} [:db_update_placeholder_3] => [:db_update_placeholder_4] => s:23:"Voir tout l'assortiment"; [:db_update_placeholder_5] => [:db_update_placeholder_6] => menu_link_content:d85a7ad1-a15e-486f-9d1d-bae895757fc3 [:db_update_placeholder_7] => -47 [:db_update_placeholder_8] => a:2:{s:10:"attributes";a:1:{s:5:"class";a:1:{i:0;s:9:"item-link";}}s:5:"query";a:0:{}} [:db_update_placeholder_9] => 0 [:db_update_placeholder_10] => 1 [:db_update_placeholder_11] => menu_link_content [:db_update_placeholder_12] => a:1:{s:9:"entity_id";s:3:"126";} [:db_update_placeholder_13] => Drupal\menu_link_content\Plugin\Menu\MenuLinkContent [:db_update_placeholder_14] => \Drupal\menu_link_content\Form\MenuLinkContentForm [:db_update_placeholder_15] => menu_link_content:acf61897-1efb-45cf-adb0-db91298c95b4 [:db_update_placeholder_16] => 1 [:db_update_placeholder_17] => 0 [:db_update_placeholder_18] => 3 [:db_update_placeholder_19] => 2705 [:db_update_placeholder_20] => 2736 [:db_update_placeholder_21] => 2771 [:db_update_placeholder_22] => 0 [:db_update_placeholder_23] => 0 [:db_update_placeholder_24] => 0 [:db_update_placeholder_25] => 0 [:db_update_placeholder_26] => 0 [:db_update_placeholder_27] => 0 [:db_update_placeholder_28] => facets_query=&f0=&f1=&f2=&f3=&f4=&f5=&f6=&f7=&f8=&f9=&f10=&f11=&f12=&f13=&f14=&f15=&f16=&f17=&f18=&f19=&f20=&f21=&f22=&f23=&f24=&f25=&f26=&f27=&f28=&f29=&f30=&f31=&f32=&f33=&f34=&f35=&f36=&f37=&f38=&f39=&display_id=page_product_catalog&view_id=product_catalog [:db_condition_placeholder_0] => 2771 ) in Drupal\Core\Menu\MenuTreeStorage->doSave() (line 330 of /var/www/html/web/core/lib/Drupal/Core/Menu/MenuTreeStorage.php).

Any idea?

Thank :)

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @JonathanWZ
  • 🇮🇹Italy Noemi Milan

    We're facing the same issue, after upgrading from 1.8.0. I don't know if there's a previous version not affected.

  • Status changed to Closed: cannot reproduce 7 months ago
  • 🇺🇸United States smustgrave

    So using 2.x and 3.x version I'm not able to reproduce the issue you are seeing. If still a valid bug maybe additional steps will be needed.

  • 🇮🇱Israel susanb

    Possible Workaround:

    I have the same error. I get this when trying to update product attributes. I haven't managed to find a fix yet, but I found that by changing the name of my path for the search_api view product_catalog to anything except what it is supposed to be (i.e, change /products to /productstempname and save the view, I am able to update the attributes. Afterwards, need to change view path back to /products and save view, clear cache and all is OK.

    I've tried different versions of facets with varying versions of Drupal core and I still get this error.

    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'route_param_key' at row 1: UPDATE "menu_tree" etc

  • 🇮🇹Italy Noemi Milan

    Hi all, eventually I solved applying the patch from this Core issue: https://www.drupal.org/project/drupal/issues/3106205 🐛 Length of menu_tree.url and menu_tree.route_param_key are too short (255 characters) Needs review .

    The issue here is that menu route field is too short to hold the whole string generated from facets.

Production build 0.71.5 2024