By emanolo78 on
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
=-=
because the classy theme is dependent on the stable theme, you cannot uninstall stable without uninstalling classy.
How to prevent uninstallation ?
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.
=-=
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?
Drupal versions are not the same
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
=-=
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.
I saw this issue too
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:
On a later config export it got removed. It seems that I updated the testing environment (
drush updb) and did adrush config:importafter 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-addedstable: 0(withoutclassy: 0) and after the suggesfull config import I removed thestable: 0entry and diddrush config:importagain. 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:importafter 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 ondrushconfig:importat the end).Yes, Same issue..
Yes, Same issue..
Thanks @osopolar, I have added in core.extension.yml. It works.
Location of the file in question
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.
Simple clear cache
When running
drush cimI got this error.So I ran
drush crand tried again, and it worked.