"The import is empty" errors validating config synchronization after core upgrade

After Drupal 9 upgrade, I can no longer use configuration synchronization to deploy configuration to Acquia Cloud environment:

 Import the listed configuration changes? (yes/no) [yes]:
 > >  [error]  DrupalCoreConfigConfigImporterException: There were errors validating the config synchronization.
> This import is empty and if applied would delete all of your configuration, so has been rejected. in DrupalCoreConfigConfigImporter->validate() (line 750 of /mnt/www/html/d9readiness/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php). 
> 
> In ConfigImportCommands.php line 360:
>                                                                                
>   The import failed due to the following reasons:                              
>   This import is empty and if applied would delete all of your configuration,  
>    so has been rejected.                                                       
>                                                                                
> 

The configuration settings are the same ones that worked before the upgrade:

$ grep -Rn '../config/default' .                  
./docroot/sites/default/settings.php:258:// $config_directories['vcs'] = '../config/default';
./docroot/sites/default/settings.php:259:// $config_directories['sync'] = '../config/default';
./docroot/sites/default/settings.php:262:$settings['config_sync_directory'] = '../config/default';
./docroot/sites/default/settings.php:263:$settings['config_vcs_directory'] = '../config/default';

My suspicion is that Acquia is overriding my settings somewhere outside of my document root, but I can’t quite find it.

Local environment is Lando with the new-ish acquia recipe, so perhaps there is some legacy config that comes with acli or something.

I’m hoping to install BLT 12 as soon as I deal with the last couple of weird errors in my local; maybe that will help me to fix the config sync issue since it comes with its own configuration overrides.

This may be related to the following error reported by the Upgrade Status module before Drupal 9 upgrade:
https://www.drupal.org/project/upgrade_status/issues/3229552#comment-14209685

UPDATE:
via Drupal Slack

mcdruid 6 hours ago

My suspicion is that Acquia is overriding my settings somewhere

…probably not answering your question directly, but you should be able to check any of the settings with e.g.

$ drush ev 'print_r(DrupalCoreSiteSettings::get("config_sync_directory"));'

I tried this, and indeed it confirms that Acquia is using different configuration which is not in my settings.php.

Here is the output from running that command in my local and on Acquia Cloud:

$ lando drush ev 'print_r(DrupalCoreSiteSettings::get("config_sync_directory"));'     
../config/default%

$ lando drush @dev ev 'print_r(DrupalCoreSiteSettings::get("config_sync_directory"));'
Enter passphrase for key '/var/www/.ssh/id_rsa':
/mnt/www/html/d9readiness/docroot/sites/default/files/config_315f86d0f57aa166d80058769033a13b1b4823d0/syncConnection to d9readiness.ssh.devcloud.acquia-sites.com closed.

$ lando drush @test ev 'print_r(DrupalCoreSiteSettings::get("config_sync_directory"));'
Enter passphrase for key '/var/www/.ssh/id_rsa': 
/mnt/www/html/d9readiness/docroot/sites/default/files/config_72c878fc6029f4e12c65fa9d1ce2afd4c3a94575/syncConnection to d9readiness.ssh.devcloud.acquia-sites.com closed.

This proves that Acquia is overriding my configuration settings.

Just to verify this, I grepped for the Dev configuration directory in my local project and no results were returned:

$ grep -Rn 'sites/default/files/config_315f86d0f57aa166d80058769033a13b1b4823d0/sync' .
$

In case the public files directory path segment was provided by stream wrapper, variable expansion or string concatenation, I tried again with only the config identifier:

$ grep -Rn '315f86d0f57aa166d80058769033a13b1b4823d0' .
$

No results again. This config is coming from someplace weird for sure.

Could it be this require near the end of settings.php?

// On Acquia Cloud, this include file configures Drupal to use the correct
// database in each site environment (Dev, Stage, or Prod). To use this
// settings.php for development on your local workstation, set $db_url
// (Drupal 5 or 6) or $databases (Drupal 7 or 8) as described in comments above.
if (file_exists('/var/www/site-php')) {
  require('/var/www/site-php/d9readiness/d9readiness-settings.inc');
}

Note: This config is at least two years old. The project is really not called d9readiness (imagine it’s called client-project-name).

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

"The import is empty" errors validating config synchronization after core upgrade

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.