A deleted module is appearing in getEditable('core.extension') Using Drupal core 8.9.6, created a custom module called wdocsApi. I wanted to rename it, so I uninstalled it and created wdocs_api. The problem is, when I try to install the new one, I get the error

Drupal\Core\Extension\Exception\UnknownExtensionException: The module wdocsApi does not exist. in Drupal\Core\Extension\ExtensionList-&gt;getPathname() (line 522 of core/lib/Drupal/Core/Extension/ExtensionList.php).

I tracked it down to Drupal/Core/Extension/ModuleInstaller.php where a call is made to $extension_config = \Drupal::configFactory()-&gt;getEditable('core.extension'); and my old module is returned in the list of modules.
What can I do to erase any remnants of the old one from my database?
There is many reasons for this and most likely the rename hapend before was completely uninstalled...
Here is a few examples of how to make sure its gone for good:

run the following somewhere
 \Drupal::service('module_installer')-&gt;uninstall(['wdocsApi']);

or Just

run drush cex to export the active config

Open up core.extension.yml  and delete the reference to  &quot;wdocsApi&quot;

run drush cim to import the config