The exception "The 'ZZ' address format can't be deleted." cause a full site configuration sync to fail during step 1 of 4 "Synchronizing configuration".

CommentFileSizeAuthor
#4 address_syncing.patch727 bytesR.Muilwijk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

freblasty created an issue. See original summary.

ransomweaver’s picture

I confirm this problem; I see it when I do drush config-import. I have the need to export config and commit to VCS so that collaborators can import it, and if the file address.address_format.ZZ.yml is in the imported config, I get this error:

exception 'Drupal\Core\Entity\EntityStorageException' with message 'The 'ZZ' address format can't be deleted.' in modules/contrib/address/src/AddressFormatStorage.php:19

My solution is to gitignore address.*ZZ.yml in my config directory

bojanz’s picture

class AddressFormatStorage extends ConfigEntityStorage {

  /**
   * {@inheritdoc}
   */
  protected function doDelete($entities) {
    // ZZ is the fallback address format and it must always be present.
    if (array_key_exists('ZZ', $entities) && current($entities)->isUninstalling() === FALSE) {
      throw new EntityStorageException("The 'ZZ' address format can't be deleted.");
    }

So we either need to replace the isUninstalling() check with isSyncing(), or have both. Needs research.

R.Muilwijk’s picture

FileSize
727 bytes

The attached patch let's me import the config on site-install.

mglaman’s picture

Status: Active » Needs review

Ran into this, as well. Fixing issue status.

mglaman’s picture

I believe this happens when you reset the site's UUID, so it will delete the format ZZ since the site's UUID does not match, but a new one will import.

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

Yep! This does the trick :D

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

Improved the fix and committed.

  • bojanz committed a6e7c14 on 8.x-1.x authored by R.Muilwijk
    Issue #2663412 by R.Muilwijk: "The 'ZZ' address format can't be deleted...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

R.Muilwijk’s picture