I'm working in the unsupported use case where I install a new site and adapt the uuid so it matches my config uuid.

The default language I'm working from is dutch. I export config, install the site again, adapt the uuid and import the config. I get this error:
[ERROR] An error accurred while trying to write the config file: "Can not delete the default language"
which is thrown in core/modules/language/src/Entity/ConfigurableLanguage on line 155.

If I delete the language.entity.nl.yml file before install, it works

Comments

daften created an issue. See original summary.

olofjohansson’s picture

Status: Active » Fixed

I had the same issue, and it appears to happen since the UUID of the default language is different, which makes sense since it's created during installation.

I solved this per the instructions at https://drupal.stackexchange.com/a/190282. Change system.site to language.entity.nl, or whatever language you're using as default.

IMO this isn't an issue which needs a fix since it makes sense that Drupal wants to delete the default language due to the different UUID.

daften’s picture

Status: Fixed » Closed (works as designed)

If it's closed like this, it's a won't fix or works as designed, since nothing is fixed...

a.milkovsky’s picture

Status: Closed (works as designed) » Needs work

I experience the same issue.
I install website via drush: "drush site-install config-dir=../config/sync minimal".
I have English and German languages enabled. English is default.

stevieb’s picture

I'm seeing the same issue on a german site and config import on fresh install
deleting the language.entity.del.yml before import worked for me

pavlosdan’s picture

Setting the default language uuid (in my case the english language) the same way we set the system.site uuid before the import helped in our case.