Getting this error on the features overview page, since I updated core to the latest 8.2.x-dev (2016-08-01).

Recoverable fatal error: Argument 2 passed to Drupal\features\ConfigurationItem::__construct() must be of the type array, boolean given, called in /modules/contrib/features/src/FeaturesManager.php on line 1125 and defined in Drupal\features\ConfigurationItem->__construct() (line 107 of /www/modules/contrib/features/src/ConfigurationItem.php).

Comments

kriboogh created an issue. See original summary.

kriboogh’s picture

Did some more debugging. Apparently some entity config has gone corrupt or something. Stepping through the code, at some point in FeaturesManager listConfigByType is called.

FeaturesManager.php line 1033

 public function listConfigByType($config_type) {
   ...
      $entity_storage = $this->entityManager->getStorage($config_type);
      $names = [];
      foreach ($entity_storage->loadMultiple() as $entity) {
        $entity_id = $entity->id();
        if ($entity_id == null) continue;
        $label = $entity->label() ?: $entity_id;
        $names[$entity_id] = $label;
      }
   ...

In the foreach loop the $entity object contains all null values. The entity in question is of type 'embed_button'. Anyway $entity->id() and $entity->label() both return null, so an entry is made in the $names array with null as key and value.

Making the calling code at line 1115 to fail:

FeaturesManager.php line

     $config = $this->listConfigByType($config_type);
     foreach ($config as $item_name => $label) {
          $name = $this->getFullName($config_type, $item_name);
          $data = $this->configStorage->read($name); 

          $config_collection[$name] = (new ConfigurationItem($name, $data, [         <<<<<< fails because $data is false
          ...
mpotter’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

Will be difficult to help with this without a procedure to reproduce it. Sounds related to something corrupted on your site with the embed_button entity, but no information on what that is. The fact the core entityManager is returning null values isn't really something Features can do much about.

kriboogh’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No worries. I reinstalled the site from scratch and now it is gone.

nielsvandermolen’s picture

Status: Closed (cannot reproduce) » Active
StatusFileSize
new560 bytes

We have found this issue on multiple sites when updating Open Social.
This patch at least makes sure the reverting of features can continue but it seems we need better debugging tools to determine which config is corrupt.

We suspect an incorrect config somewhere but this is very difficult to find out. This is the entity that was being added that results in the error for the 'view' config entity:

class Drupal\views\Entity\View#5531 (27) {
  protected $base_table =>
  string(4) "node"
  protected $id =>
  NULL
  protected $label =>
  NULL
  protected $description =>
  string(0) ""
  protected $tag =>
  string(0) ""
  protected $core =>
  string(3) "8.x"
  protected $display =>
  array(1) {
    'default' =>
    array(5) {
      'display_options' =>
      array(3) {
        ...
      }
      'display_plugin' =>
      NULL
      'id' =>
      NULL
      'display_title' =>
      string(0) ""
      'position' =>
      NULL
    }
  }
  protected $base_field =>
  string(3) "nid"
  protected $executable =>
  NULL
  protected $module =>
  string(5) "views"
  protected $originalId =>
  NULL
  protected $status =>
  bool(true)
  protected $uuid =>
  NULL
  private $isSyncing =>
  bool(false)
  private $isUninstalling =>
  bool(false)
  protected $langcode =>
  string(2) "en"
  protected $third_party_settings =>
  array(0) {
  }
  protected $_core =>
  array(0) {
  }
  protected $trustedData =>
  bool(false)
  protected $entityTypeId =>
  string(4) "view"
  protected $enforceIsNew =>
  NULL
  protected $typedData =>
  NULL
  protected $cacheContexts =>
  array(0) {
  }
  protected $cacheTags =>
  array(0) {
  }
  protected $cacheMaxAge =>
  int(-1)
  protected $_serviceIds =>
  array(0) {
  }
  protected $dependencies =>
  array(0) {
  }
}
nielsvandermolen’s picture

Our issue was a corrupt view in the Group module (https://www.drupal.org/project/group) in beta 3. The issue was with the Groups nodes view.

Updating Group to beta 4 resolved the issue.

For future issues it would be very helpful to determine which config file is responsible for the incorrect entity.

mpotter’s picture

I'm not sure it's Features place to audit your configuration. Would probably be better in core, but until then I'm happy to consider a patch that uses drupal_set_message to display warnings if incorrect config is found. But the patch in #5 is just a specific workaround, so it's the one we want. I'm also not sure in what ways different config might be corrupted that we would need to test for. Seems like a fairly complicated issue.

themic8’s picture

Has anything been put in place to display warnings for incorrect configurations?

nedjo’s picture

Has anything been put in place to display warnings for incorrect configurations?

In Features? No.

yingtho’s picture

I have added the patch to show which config name there was error on and skip if config element as well.

nedjo’s picture

Status: Active » Fixed

@yingtho

Thanks for the patch, which may be useful to others trying to diagnose broken configuration on their sites.

As diagnosing such problems is beyond the scope of what we're doing here, closing this support request.

Status: Fixed » Closed (fixed)

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

socialnicheguru’s picture

OK. I got this error on the upgrade from geolocation from 1.x to 2.x.

in 1.x there is a route geolocation.settings which is not in 2.x.

Without this patch helping me identify the issue, I would have never found it.

Now the issue is howto correct the missing settings file which is no longer needed.

I had to remove white space at line 19 and 49 of the patch otherwise there is a fatal error of corruption.