Where are config dependencies stored? I have this error when importing a single piece of config manually:


  Configuration foo.api depends on the MODULE extension that will not be installed after import.


There is no "MODULE" extension in the file system, core.extension config, the KeyValue table, config_snaphot, or anywhere else that I'm aware of that would be related.

If I delete the config

\Drupal::configFactory()-&gt;getEditable('foo.api')-&gt;delete();


Then try the import, it works. Great.

But as soon as I go back to my config form and save foo.api, the next time I try to import, I get the same error all over again.

This leads me to believe that a dependency tree must be stored somewhere, and that it isn't cleared when config is deleted.

Is this true, and if so where is it? If not, how can I resolve this?

I guess this could also be rephrased as How are module dependencies for basic configuration calculated, and how do you manually update them when they’re wrong?
The error you see is output from ConfigImportSubscriber::validateDependencies(), which uses the following code.

  // Validate the dependencies of all the configuration. We have to validate
  // the entire tree because existing configuration might depend on
  // configuration that is being deleted.
  foreach ($config_importer
    -&gt;getStorageComparer()
    -&gt;getSourceStorage()
    -&gt;listAll() as $name) {

    // Ensure that the config owner is installed. This checks all
    // configuration including configuration entities.
    list($owner, ) = explode('.', $name, 2);
    if ($owner !== 'core') {
      $message = FALSE;
      if (!isset($core_extension['module'][$owner]) &amp;&amp; isset($module_data[$owner])) {
        $message = $this
          -&gt;t('Configuration %name depends on the %owner module that will not be installed after import.', [
          '%name' =&gt; $name,
          '%owner' =&gt; $module_data[$owner]-&gt;info['name'],
        ]);
      }


The code assumes that for a name like node.type.article the owner is the Node module. If the owner is not one of the installed modules, Drupal gives the error you see.

To answer your question, the module name is assumed to be stored in the configuration filename.