acquia / df

Demo Framework - mirrored at https://git.drupal.org/project/df.git
https://www.drupal.org/project/df
18 stars 19 forks source link

Unable to import an updated CDF. #210

Open kevinfunk opened 4 years ago

kevinfunk commented 4 years ago

Recently I tried to update the title of the home page in dfs_one. I was able to export a new CDF without an issue, but when I tried to do a new build with the updated CDF, I got an error.

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'menu_name' at row 1: INSERT INTO {menu_tree} (id, menu_name) VALUES
   (:db_insert_placeholder_0, :db_insert_placeholder_1); Array
  (
      [:db_insert_placeholder_0] => menu_link_content:01c91444-fb68-4646-9e53-3ce24f2fc66b
      [:db_insert_placeholder_1] => swijathehotroclovihubutewrewruwaslushoswewakegoprucethubrunutrivopramafrediwophuclofripruphacleclutudacoje
  )
saltednut commented 4 years ago

Adding @EclipseGc for some visibility. No changes on our end other than keeping modules and libraries as up to date as possible.

saltednut commented 4 years ago

We are on a specific hash for the PHP library, based on some conversations we had last week when installations were broken using existing CDFs that were exported months ago, as well.

https://github.com/acquia/df/blob/8.x-4.x/composer.json#L214

EclipseGc commented 4 years ago

Ok, so 2 things:

  1. You guys should no longer need to be pinned to a particular hash. We did releases for the library, contenthub and depcalc earlier this week, so you can just go back to using dev or the latest release. Latest release is now pinned to released versions of the library and depcalc.
  2. That menu link title looks like it was generated. This is a core bug wherein the generated strings are longer than the database column limits. How did you build this menu?
saltednut commented 4 years ago

Ok cool, we can update to use the tagged releases.

The workflow is to create everything via the UI then export a CDF package. Additionally, our configuration for this scenario does not call for the Scenarios module to load all menu_link_content as a proper dependent - e.g. provide it to depcalc for CDF-ification. So any menu_link_content that is added to the CDF could only have come because it was found as a dependency of one of the other dependents. This might make more sense if I share what our config form looks like as far as what we "export" when we request a CDF.

Screen Shot 2020-02-27 at 11 52 29 AM
saltednut commented 4 years ago

Looks like there's no menu_link_content on the demo site - I wonder if that string is part of an incomplete dataset?

EclipseGc commented 4 years ago

Like I said, it looks like a generated entity. This can happen a couple of different ways, but most commonly, it can happen on import when 2 (or more) entities have dependencies on each other. Does your CDF export have a menu_link_content entity in it?

saltednut commented 4 years ago

It does. But I am not sure why since we don't see any menu link content actually in on the site.

 ack menu_link_content
dfs_one.json
26474:                        "target": "menu_link_content"
29273:                        "target": "menu_link_content"
29989:                        "target": "menu_link_content"
32309:                        "target": "menu_link_content"
32898:                        "target": "menu_link_content"
34409:                        "target": "menu_link_content"
37363:                        "target": "menu_link_content"
38353:                        "target": "menu_link_content"
38984:                        "target": "menu_link_content"

Could these be legacy items that are hanging around?

saltednut commented 4 years ago

Another quick check to see if there's any entities (checking if array is empty)

drush ev 'drush_print(empty(array_keys(entity_load_multiple("menu_link_content"))));'
1
drush ev 'drush_print(empty(array_keys(entity_load_multiple("user"))));'