Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
bircherDid 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.
Comment #3
a.henry CreditAttribution: a.henry commentedI 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
Any clue of what is going wrong?
Comment #4
a.henry CreditAttribution: a.henry commentedComment #5
roborew CreditAttribution: roborew at Christian Aid commentedI'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.
Comment #7
bircherindeed! 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!
Comment #8
david.gil CreditAttribution: david.gil at Biko2 commentedHi,
the same here, i require dev version but the error is still there:
as a workaround i commented: onfig_split.cli in config_split.services.yml, then run updb and uncomment.
Best
Comment #10
bircherOk, 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.
Comment #11
birchermore feedback may be needed.
Comment #12
a.henry CreditAttribution: a.henry commentedIt works for me with the latest dev version.
The beta3 version is working too if I delete these lines from my service.yml file:
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
Comment #13
bircherI'll add it to the beta4 release notes.
Comment #14
david.gil CreditAttribution: david.gil at Biko2 commentedIt is working for me now
Thx
Comment #15
roborew CreditAttribution: roborew at Christian Aid commentedWorking 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.
Comment #16
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commented@roborew - I think you mean
drush csex
(not csim :)I ran into this as well, as I was running the
config-split-import
beforeupdb
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!
Comment #17
bircherI have to disagree here.
This is not a chicken-and-egg issue! You have to always
updb
beforecim
. 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.
Comment #18
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedThis 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.
Comment #19
roborew CreditAttribution: roborew at Christian Aid commented@bircher yep we follow exactly these steps when building locally or on Platform:
@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.
Comment #20
bircherYes of course!
The developer who introduces the change, or in other words the one changing the composer file would run
drush updb
and thendrush cex
. The others (and deployment) usedrush 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!).Comment #21
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedhook_post_cim_N
- Nice!Comment #22
scuba_flyrunning
druhs updb
fixed it for me. Now I can do adrush csim
again.Comment #24
bircherAdding reference to core issue.
Comment #25
Anisorf CreditAttribution: Anisorf commentedI'm having this problem with drupal 8.5 after updating to config split 8x-1.3.
any help will be appreciated
Comment #26
bircher@Anisorf which version of config_split are you updating from? You need to install config_filter before updating.