Hi,

I've been trying to import configurations from a previous Drupal site (both made under Drupal 9). I tried to perform the import with the Configuration manager but I'm getting an error message:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=19&op=do_nojs&op=do
StatusText: 500 Service unavailable (with message)
ResponseText: The website encountered an unexpected error. Please try again later.InvalidArgumentException: The base theme stable cannot be uninstalled, because theme classy depends on it. in Drupal\Core\Extension\ThemeInstaller->uninstall() (line 272 of core/lib/Drupal/Core/Extension/ThemeInstaller.php). Drupal\Core\Config\ConfigImporter->processExtension() (Line: 570)

It seems that a theme uninstallation prevents the configuration from being imported.

Is it normal and is there a way to fix it ?

Comments

vm’s picture

because the classy theme is dependent on the stable theme, you cannot uninstall stable without uninstalling classy.

emanolo78’s picture

Thank you for the feed-back.

The issue is that I do not try to uninstall anything: I just try to import a configuration tar.gz file which contains the data model of a previous site.

I did not remove any theme in the site from which I generated the archive nor on the site on which I'm trying to import it.

vm’s picture

suggest reviewing the configuration file line by line or paste the contents of the file to pastebin.org for review. Something in there is triggering the issue.

A google search indicates you're post and the only report of the issue and I can't reproduce it. Are the versions of Drupal 9.x the exact same?

emanolo78’s picture

Which file from the configuration should I share with you ? There are many files. Do you want the whole tar.gz ?

I switched drupal versions: the source version is drupal 9.0, the current version is drupal 9.1

vm’s picture

the version change would make me take a step back. I'd try importing the config into a 9.0 site before proceeding to better understand if there is a version conflict.

osopolar’s picture

I saw this problem on my test environment too while upgrading from drupal 8 to drupal 9. I don't know why, but after update on dev environment en config export I still had the themes in my core.extension.yml config file:

theme:
  stable: 0
  classy: 0

On a later config export it got removed. It seems that I updated the testing environment (drush updb) and did a drush config:import after that, which might had enabled these themes (at least somehow in config). I am not sure if drush pmu classy worked or not, I ended up editing the core.extension.yml file and re-added stable: 0 (without classy: 0) and after the suggesfull config import I removed the stable: 0  entry and did drush config:import again. Everything works fine now.

On the production environment I didn't experience this issue. I guess because on test environment I did the drupal 8 to drupal 9 upgrade in multiple steps (multiple drushconfig:import after each step) as I tested the upgrade and later I added some drupal 9 security updates before going live. On production in did just one upgrade (with just on drushconfig:import at the end).

thirstysix’s picture

Yes, Same issue.. 

Thanks @osopolar, I have added in core.extension.yml. It works.

theme:
  stable: 0
  classy: 0
sjhuskey’s picture

Adding the items recommended by @osopolar worked for me, but it took me a moment to find the core.extensions.yml file. In case anyone else wonders about this, it's in the sync directory inside of your config directory. For me, that was config/config[hash]/sync, where [hash] is the unique string appended to the internal config directory.

jkdev’s picture

When running drush cim I got this error.

So I ran drush cr and tried again, and it worked.