Ran composer update and now getting a dependancy injection error related to config_split:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "config_split.cli" has a dependency on a non-existent service                     [error]
"plugin.manager.config_filter". in
/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:58
Stack trace:
#0 /vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(42):
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processReferences(Array)
#1 /vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(36):
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processDefinition(Object(Symfony\Component\DependencyInjection\Definition))
#2 /vendor/symfony/dependency-injection/Compiler/Compiler.php(104):
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->process(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#3 /vendor/symfony/dependency-injection/ContainerBuilder.php(590):
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#4 /web/core/lib/Drupal/Core/DrupalKernel.php(1263):
Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#5 /web/core/lib/Drupal/Core/DrupalKernel.php(866): Drupal\Core\DrupalKernel->compileContainer()
#6 /web/core/lib/Drupal/Core/DrupalKernel.php(461): Drupal\Core\DrupalKernel->initializeContainer()
#7 /vendor/drush/drush/lib/Drush/Boot/DrupalBoot8.php(149): Drupal\Core\DrupalKernel->boot()
#8 /vendor/drush/drush/includes/bootstrap.inc(354): Drush\Boot\DrupalBoot8->bootstrap_drupal_full()
#9 /vendor/drush/drush/includes/bootstrap.inc(509): drush_bootstrap(5, 7)
#10 /vendor/drush/drush/commands/core/help.drush.inc(103): drush_bootstrap_max()
#11 /vendor/drush/drush/includes/command.inc(422): drush_core_help()
#12 /vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#13 /vendor/drush/drush/includes/command.inc(199): drush_command()
#14 /vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#15 /vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#16 /vendor/drush/drush/drush.php(12): drush_main()
#17 {main}

Looks like something has changed after a vendor update, but any thoughts on this?

Comments

roborew created an issue. See original summary.

bircher’s picture

Status: Active » Postponed (maintainer needs more info)

Did you run update.php (drush updb)?

Config Split now depends on Config Filter which you will have downloaded with the composer update and which will be installed with the update hook in Config Split.

The service you are missing is defined in Config Filter, which will be available after it is installed and caches are cleared.

Please close or re-open the issue if this doesn't fix things.

a.henry’s picture

I am also having trouble upgrading to beta3.

Tried to download and install config_filter (with cache rebuild) before updating config_split with composer.

But then I get the following error everywhere

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "config_split.manager". in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 816 of /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php).
Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition('config_split.manager') (Line: 461)
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->getReferenceCall('config_split.manager', Object) (Line: 409)
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->dumpValue(Object) (Line: 352)
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->dumpCallable(Array) (Line: 261)
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->getServiceDefinition(Object) (Line: 125)
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->getServiceDefinitions() (Line: 66)
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->getArray() (Line: 873)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 461)
Drupal\Core\DrupalKernel->boot() (Line: 651)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Any clue of what is going wrong?

a.henry’s picture

Status: Postponed (maintainer needs more info) » Active
roborew’s picture

I've run drush updb and it still kicks out the error above.

Got a catch 22, can't install the new module to fix the error with out config split creating the dependancy error, the hook update doesn't get a chance to run without the config filter module being installed.

Have tried to kick start things with a fresh build, and adding the module install to the config extensions, but still ran into the same issue. Last solution is to revert back to previous composer.lock file that worked. Manually reinstall the config filter dependancy, then run composer update. Will report back on findings.

  • bircher committed 47355e3 on 8.x-1.x
    Issue #2859628: Resolve dependancy on non-existent service when updating
    
bircher’s picture

Status: Active » Needs review

indeed! I see the problem.

Thanks for reporting everyone! try updating to the latest dev release and see if it fixes the problem.
(the commit mentioned above)
If it works for you in those cases I'll tag a new release.

thanks for the cooperation!

david.gil’s picture

Status: Needs review » Needs work

Hi,

the same here, i require dev version but the error is still there:


david-2:docroot david$ drush updb --y
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service        [error]
"config_split.manager". in /Users/david/Sites/thyssen/vendor/symfony/dependency-injection/ContainerBuilder.php:816
Stack trace:
#0
/Users/david/Sites/thyssen/docroot/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php(461):
Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition('config_split.ma...')
#1
/Users/david/Sites/thyssen/docroot/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php(409):
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->getReferenceCall('config_split.ma...',
Object(Symfony\Component\DependencyInjection\Reference))
#2
/Users/david/Sites/thyssen/docroot/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php(352):
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->dumpValue(Object(Symfony\Component\DependencyInjection\Reference))
#3
/Users/david/Sites/thyssen/docroot/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php(261):
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->dumpCallable(Array)
#4
/Users/david/Sites/thyssen/docroot/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php(125):
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->getServiceDefinition(Object(Symfony\Component\DependencyInjection\Definition))
#5 /Users/david/Sites/thyssen/docroot/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php(66):
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->getServiceDefinitions()
#6 /Users/david/Sites/thyssen/docroot/core/lib/Drupal/Core/DrupalKernel.php(873):
Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper->getArray()
#7 /Users/david/Sites/thyssen/docroot/core/lib/Drupal/Core/DrupalKernel.php(461):
Drupal\Core\DrupalKernel->initializeContainer()
#8 /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Boot/DrupalBoot8.php(149): Drupal\Core\DrupalKernel->boot()
#9 /Applications/DevDesktop/tools/vendor/drush/drush/includes/bootstrap.inc(354):
Drush\Boot\DrupalBoot8->bootstrap_drupal_full()
#10 /Applications/DevDesktop/tools/vendor/drush/drush/includes/bootstrap.inc(473): drush_bootstrap(5, 5)
#11 /Applications/DevDesktop/tools/vendor/drush/drush/commands/core/drupal/update.inc(107): drush_bootstrap_to_phase(5)
#12 /Applications/DevDesktop/tools/vendor/drush/drush/commands/core/core.drush.inc(462): update_main()
#13 /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc(373): drush_core_updatedb()
#14 /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc(224): _drush_invoke_hooks(Array, Array)
#15 /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc(192): drush_command()
#16 /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#17 /Applications/DevDesktop/tools/vendor/drush/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#18 /Applications/DevDesktop/tools/vendor/drush/drush/drush.php(12): drush_main()
#19 {main}

as a workaround i commented: onfig_split.cli in config_split.services.yml, then run updb and uncomment.

Best

  • bircher committed 9cc18d6 on 8.x-1.x
    Issue #2859628: Add legacy service so people who overwrote it can update...
bircher’s picture

Status: Needs work » Fixed

Ok, thanks to aspilicious on IRC, we found out that this could be due to manually overriding the sync storage service.

I added the service back for now, but I will remove it before the 1.0.0 stable release.

bircher’s picture

Priority: Normal » Critical
Status: Fixed » Needs review

more feedback may be needed.

a.henry’s picture

It works for me with the latest dev version.
The beta3 version is working too if I delete these lines from my service.yml file:

services:
  config.storage.sync:
    class: Drupal\config_split\Config\StorageWrapper
    factory: config_split.manager:getDefaultStorageWrapper

Which I discovered by looking at your commit.
I didn't know this override was no longer needed when upgrading to beta3.

Thanks a lot for your fast response and help

bircher’s picture

Status: Needs review » Fixed

I'll add it to the beta4 release notes.

david.gil’s picture

It is working for me now

Thx

roborew’s picture

Working for me now also, many thanks.

Successfully deployed to platform.sh after updating the module. I Installed and updated the site with out issue locally using the latest dev. But tried again to document and recreate the steps against the master database and ran into some similar errors to the one above..

In my case I had found that the steps I was taking were slightly out of order so needed todo some sanity checking. Made sure the site was back working with the previous composer.lock file and config imported. Then updated composer.json to use the dev version of config split and ran composer update and then drush updb and it worked: Config Filters module was installed as a dependancy and enabled with the hook update. Once this was done correctly then used drush csim to export config and deploy.

Many thanks @bircher for your quick response on the issue.

geerlingguy’s picture

@roborew - I think you mean drush csex (not csim :)

I ran into this as well, as I was running the config-split-import before updb in my automated deployments. Even if you have config_filter added to your core.extensions.yml, it won't get enabled until after updb is run... so you kinda have to run database updates first at least in this case.

A bit of a chicken-and-egg issue that frequently plagues configuration-related architecture changes!

bircher’s picture

I have to disagree here.

This is not a chicken-and-egg issue! You have to always updb before cim. Maybe this needs to be documented somewhere more prominent.

The whole point of update hooks is to ensure that the database is in a workable state again from when code has changed. See #2628144: Ensure that ConfigImport is taking place against the same code base and #2762235: Ensure that ConfigImport is taking place without outstanding updates.

Typically in our projects we want to abuse the update hooks to create/update content after the configuration has changed. But that is not what update hooks are supposed to be used for and there are other options. I guess that will be a topic of a future blog post.

geerlingguy’s picture

Typically in our projects we want to abuse the update hooks to create/update content after the configuration has changed.

This is exactly the reason the order was in the way described :(

Unfortunately, it's difficult to make sure certain changes can be deployed in a single deployment if the order is reversed. But I definitely understand that updb then import is the 'correct' order.

roborew’s picture

@bircher yep we follow exactly these steps when building locally or on Platform:

drush -y updatedb
drush -y csim

@geerlingguy think I missed a step drush csim first, then config changes, drush csex to deploy.

However, we found an interesting issue with a webform update, the module has added a new field for form status that now has three states. In the file config though these new states weren't reflected. So even though we updated the module, updated the Db and then re-imported the config, as the new settings were missing from the webform config we inadvertently turned off our forms.

Obviously this is where things need testing throughly before being deployed. But actually this does mean in some cases it might be better to update then export config first.

Therefore, I don't think its as black and white.. for day-to-day development and builds drush updb followed by drush csim is correct, specially when sharing feature branches. But if you run composer update and updb, then you need to make any config alterations are reflected back in the git repo and merged back into dev branch as soon as possible for others to update with, in this case conflicts are handled in merge as apposed to wiping out config in the database. When doing this a fresh database dump from production should be used representing the current config live state.

bircher’s picture

Yes of course!

The developer who introduces the change, or in other words the one changing the composer file would run drush updb and then drush cex. The others (and deployment) use drush cim to get the changed configuration.
If you consider updating the composer file as being just another action someone does while developing it is in my opinion really easy to remember the steps. You wouldn't add a new content type and then do drush cim, as that would remove the content type. In the same way you wouldn't update the module and then revert the changes to the configurations the update introduces by importing the configuration from before the update. All the other instances will run the database update and then synchronise (import) the updated config of course. This is actually another reason it is important to do the update first.

The only time developers are tempted to do it the other way around is when they create update hooks that depend on the new configuration which is about to be deployed. Basically because there is no hook_post_cim_N (yet.. stay tuned!).

geerlingguy’s picture

hook_post_cim_N - Nice!

scuba_fly’s picture

running druhs updb fixed it for me. Now I can do a drush csim again.

Status: Fixed » Closed (fixed)

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

bircher’s picture

Adding reference to core issue.

Anisorf’s picture

I'm having this problem with drupal 8.5 after updating to config split 8x-1.3.

The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "config_split.cli" has a dependency on a non-existent service "plugin.manager.config_filter". in Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue() (line 32 of /var/www/my_site/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php).

Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object, ) (Line: 60)
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue(Array, ) (Line: 29)
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Array) (Line: 67)
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue(Object, 1) (Line: 29)
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object, 1) (Line: 60)
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue(Array, 1) (Line: 29)
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Array, 1) (Line: 39)
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->process(Object) (Line: 141)
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object) (Line: 759)
Symfony\Component\DependencyInjection\ContainerBuilder->compile() (Line: 1307)
Drupal\Core\DrupalKernel->compileContainer() (Line: 884)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 40)
Drupal\Core\Update\UpdateKernel->initializeContainer() (Line: 466)
Drupal\Core\DrupalKernel->boot() (Line: 62)
Drupal\Core\Update\UpdateKernel->handle(Object) (Line: 19)

any help will be appreciated

bircher’s picture

@Anisorf which version of config_split are you updating from? You need to install config_filter before updating.