Fatal error on cache clear after updating to 7.x-2.15 with features + data + eck

Created on 5 October 2023, 9 months ago
Updated 13 June 2024, 15 days ago

Problem/Motivation

We're using data + eck module and after updating from features 7.x-2.14 to 7.x-2.15 the following Fatal Error appears on clearing cache (via cache flush UI or drush cc all):

Fatal error: Uncaught TypeError: Argument 2 passed to SelectQuery::fields() must be of the type array, null given, called in /includes/entity.inc on line 320 and defined in /includes/database/select.inc:1347 Stack trace: 
#0 /includes/entity.inc(320): SelectQuery->fields('base', NULL) 
#1 /sites/all/modules/contrib/entity/includes/entity.controller.inc(175): DrupalDefaultEntityController->buildQuery(Array, Array, false) 
#2 /sites/all/modules/contrib/entity/includes/entity.controller.inc(719): EntityAPIController->buildQuery(Array, Array, false) 
#3 /sites/all/modules/contrib/entity/includes/entity.controller.inc(192): EntityAPIControllerExportable->buildQuery(false, Array, false) 
#4 /sites/all/modules/contrib/entity/includes/entity.controller.inc(256): EntityAPIController->query(false, Array, false) 
#5 /sites/all in /includes/database/select.inc on line 1347

Diving deeper, the relevant part of the error behind backtrace is:

[...]
#8  watchdog(php, %type: !message in %function (line %line of %file)., Array ([%type] => Notice,[!message] => Trying to access array offset on value of type bool,[%function] => drupal_schema_field_types(),[%file] => /includes/common.inc,[%line] => 7388,[severity_level] => 5), 5) called at [/includes/errors.inc:208]
#9  _drupal_log_error(Array ([%type] => Notice,[!message] => Trying to access array offset on value of type bool,[%function] => drupal_schema_field_types(),[%file] => /includes/common.inc,[%line] => 7388,[severity_level] => 5), ) called at [/includes/errors.inc:73]
#10 _drupal_error_handler_real(8, Trying to access array offset on value of type bool, /includes/common.inc, 7388) called at [/includes/bootstrap.inc:2667]
#11 _drupal_error_handler(8, Trying to access array offset on value of type bool, /includes/common.inc, 7388, Array ([table] => eck_crm_portrait_fachverband,[table_schema] => ,[field_types] => Array ())) called at [/includes/common.inc:7388]
#12 drupal_schema_field_types(eck_crm_portrait_fachverband) called at [/includes/common.inc:8036]
#13 entity_get_info() called at [/sites/all/modules/contrib/entity/entity.module:762]
#14 entity_crud_get_info() called at [/sites/all/modules/contrib/entity/entity.features.inc:146]
#15 entity_features_api() called at [/includes/module.inc:966]
#16 module_invoke_all(features_api) called at [/sites/all/modules/contrib/features/features.module:660]
#17 features_get_components(, file, ) called at [/sites/all/modules/contrib/features/features.module:477]
#18 features_include() called at [/sites/all/modules/contrib/features/features.module:1341]
#19 features_ctools_plugin_api_alter(Array ([breakpoints] => Array ([version] => 1,[path] => sites/all/modules/contrib/breakpoints)), data, data_default, ) called at [/includes/module.inc:1172]
#20 drupal_alter(ctools_plugin_api, Array ([breakpoints] => Array ([version] => 1,[path] => sites/all/modules/contrib/breakpoints)), data, data_default) called at [/sites/all/modules/contrib/ctools/includes/plugins.inc:114]
#21 ctools_plugin_api_info(data, data_default, 1, 1) called at [/sites/all/modules/contrib/ctools/includes/plugins.inc:147]
#22 ctools_plugin_api_include(data, data_default, 1, 1) called at [/sites/all/modules/contrib/ctools/includes/export.inc:677]
#23 _ctools_export_get_defaults(data_tables, Array ([key] => name,[identifier] => data_table,[default hook] => data_default,[api] => Array ([owner] => data,[api] => data_default,[minimum_version] => 1,[current_version] => 1),[key name] => Name,[object] => stdClass,[status] => default_data_tables,[can disable] => 1,[primary key] => name,[bulk export] => 1,[list callback] => data_data_tables_list,[to hook code callback] => data_data_tables_to_hook_code,[cache defaults] => ,[default cache bin] => cache,[export type string] => type,[boolean] => 1)) called at [/sites/all/modules/contrib/ctools/includes/export.inc:496]
#24 ctools_export_load_object(data_tables, all, Array ()) called at [/sites/all/modules/data/data.module:358]
#25 _data_load_table(, 1) called at [/sites/all/modules/data/data.module:22]
#26 data_get_all_tables(1) called at [/sites/all/modules/data/data.install:78]
[...]

and finally one of these lines seem to cause the trouble:

#17 features_get_components(, file, ) called at [/sites/all/modules/contrib/features/features.module:477]
#18 features_include() called at [/sites/all/modules/contrib/features/features.module:1341]
#19 features_ctools_plugin_api_alter(Array ([breakpoints] => Array ([version] => 1,[path] => sites/all/modules/contrib/breakpoints)), data, data_default, ) called at [/includes/module.inc:1172]

These are the changes from 2.14 to 2.15: https://git.drupalcode.org/project/features/-/compare/7.x-2.14...7.x-2.1...

No idea what may have caused this issue. But downgrading to 2.14 definitely fixes the issue and cache clear works again. No more errors, warnings or even notices.

We already checked data and eck settings and values, all seems to be fine.

Steps to reproduce

See above

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.15

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

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

Comments & Activities

  • Issue created by @Anybody
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡­πŸ‡ΊHungary danyg Budapest

    Hi, I have EntityMalformedException "Missing bundle property on entity of type file" since I updated one of my sites to 2.15.
    I checked the changes of the latest stable release and I found out that the error is gone if I comment out the features_ctools_plugin_api_alter() function.
    I wasn't able to figure out yet what was wrong with this function, but this is the point where we could start to debug.

  • πŸ‡·πŸ‡ΊRussia skylord

    Same here. It seems that calling especially _ctools_features_get_info() (first called from inside of features_include() and later from features_ctools_plugin_api_alter() itself) is the cause.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Setting priority to critical, as the reason for this issue is not easy to find and the impact is high.

  • πŸ‡­πŸ‡ΊHungary danyg Budapest

    Today I tried to update another site where data, entity, entitycache, entityconnect, entityform, entityreference, and some other entity* modules are installed. This time I didn't face any issues, clearing cache on th UI or by drush works like a charm.
    I'm going to update the other site I reported 8 months ago to see whether the issue still persists there.

Production build 0.69.0 2024