We ran into the following error when updating from 8.2.x to 8.3.0-rc2

Error: Call to undefined method Drupal\Core\Config\Schema\Undefined::get() in web/core/lib/Drupal/Core/Config/StorableConfigBase.php on line 179 #0 
web/core/lib/Drupal/Core/Config/Config.php(212): 
Drupal\Core\Config\StorableConfigBase->castValue('bc_primitives_a...', false)

Debuging the code revealed this in class TypedConfigManager

public function hasConfigSchema($name) {
    // The schema system falls back on the Undefined class for unknown types.
    $definition = $this->getDefinition($name);
    return is_array($definition) && ($definition['class'] != Undefined::class);
  }

In some cases $definition['class'] was coming out as undefined, which should compare to Undefined::class,
but when debugging the actual values for each we see:

'\Drupal\Core\Config\Schema\Undefined' and 'Drupal\Core\Config\Schema\Undefined'

Further debug showed that the Undefined class definition is not being run through the processDefinition method and is therefore not being stripped of the leading \.

We should maybe do something like:

(ltrim($definition['class'], '\\') !== Undefined::class)

We have cleared the fault by clearing caches before doing the upgrade, however felt we should document this as a bug.

Comments

glynnr created an issue. See original summary.

cilefen’s picture

Priority: Normal » Major
therobyouknow’s picture

Thank you - your advice helped:

We have cleared the fault by clearing caches before doing the upgrade, however felt we should document this as a bug.

So I clear the caches - with the following command:
drush cr

then ran the upgrade/update:
drush updb

and the upgrade completed.

Thank you.

bradjones1’s picture

Version: 8.3.0-rc2 » 8.6.x-dev
Priority: Major » Normal
Status: Active » Closed (cannot reproduce)

Not major and the RP and a commenter say a cache clear solved their problem; closing.