Non-existent service "colorbox.attachment"

Created on 17 June 2022, over 2 years ago
Updated 29 August 2024, 3 months ago

When updating to Drupal 9.4.0 it is not possible to run the database updates

The Error reported is:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "colorbox.attachment". in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 1030 of /code/vendor/symfony/dependency-injection/ContainerBuilder.php).

Steps to reproduce

Install Video Embed Field in a Drupal 9.3.x website. Run composer update then run drush updb.

Proposed resolution

Add a dependency on colorbox or remove the offending code. The dependency on "colorbox.attachment" is in two areas as folows:

./web/modules/contrib/video_embed_field/tests/src/Kernel/KernelTestBase.php:79:    
        $this->container->set('colorbox.attachment', $colorbox_mock);


./web/modules/contrib/video_embed_field/src/Plugin/Field/FieldFormatter/Colorbox.php:105:      
        $container->get('colorbox.attachment')

To resolve the issue on my site, I installed colorbox. I'm not using it but it makes the "colorbox.attachment" service available and I am able to run the database updates.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇦Canada awasson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • @bserem opened merge request.
  • Status changed to Needs review almost 2 years ago
  • 🇬🇷Greece bserem

    MR fixes the update problem, but adds colorbox as a dependency to the site. Sites not having colorbox before will have to install it in order to run the updates.

    With Drupal 9.3 not being supported anymore I'm raising this to critical, since D9.4+ can't complete the updates when video_embed_field is enabled.

  • First commit to issue fork.
  • Merge request !41Conditional DI approacj → (Open) created by spokje
  • 🇳🇱Netherlands spokje

    Added a new MR with a new approach, which does not make installing and enabling module colorbox compulsory.

Production build 0.71.5 2024