Running Drupal 8.4.0 with the media_entity results in this error when running drush updb --uri=default
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
You have requested a non-existent service
"plugin.manager.media_entity.type". Did you mean this:
"plugin.manager.embed.type"? in
/mnt/www/html/swhr/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:151
Stack trace:
#0 /mnt/www/html/swhr/docroot/core/lib/Drupal.php(158):
Drupal\Component\DependencyInjection\Container->get('plugin.manager....')
#1
/mnt/www/html/swhr/docroot/modules/contrib/media_entity/media_entity.install(45):
Drupal::service('plugin.manager....')
#2
/mnt/www/html/swhr/docroot/modules/contrib/media_entity/media_entity.drush.inc(39):
_media_entity_get_incompatible_modules()
#3 /mnt/www/html/swhr/vendor/drush/drush/includes/command.inc(422):
drush_media_entity_updatedb_validate()
#4 /mnt/www/html/swhr/vendor/drush/drush/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#5 /mnt/www/html/swhr/vendor/drush/drush/includes/command.inc(199):
drush_command()
#6
/mnt/www/html/swhr/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#7 /mnt/www/html/swhr/vendor/drush/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#8 /mnt/www/html/swhr/vendor/drush/drush/drush.php(12): drush_main()
#9 {main}
Comment | File | Size | Author |
---|---|---|---|
#12 | 2919754-12.patch | 859 bytes | marcoscano |
#6 | media_entity-drush_updatedb-2919754-6-D8.patch | 651 bytes | sinn |
#2 | non-existent-serivice-2919754-1.patch | 1.37 KB | craigandrews |
Comments
Comment #2
craigandrews CreditAttribution: craigandrews as a volunteer commentedAttached is a simple patch that checks if the service exists before working with it.
Comment #3
marcoscanoFrom the patch, it appears that you are using Media Entity 2.x branch, although this issue has been filed against 8.x-1.6. Can you point out what you are trying to do?
Media Entity 1.x is expected to be compatible with Drupal >= 8.4.x as long as you don't use the core Media module (which you shouldn't be allowed to enable, anyways).
Media Entity 2.x is only intended as a bridge to perform the upgrade path to Media in core. If you used Media Entity and want to test the upgrade path, then yes you can download the 2.x branch, follow these instructions, and test the upgrade process.
If you are trying to upgrade and it doesn't work, it could be an upgrade path bug. In this case, please change this issue to be agains 2.x-dev, and provide as many details as you can about your scenario and steps you performed to reach the bug.
Thanks!
Comment #4
craigandrews CreditAttribution: craigandrews as a volunteer commentedUgh, so I made this mistake due to a confusing situation in Lightning 2.2.1. They include this block in their composer.json:
This patch https://www.drupal.org/files/issues/media-entity-1.6--c564fc4.diff appears to basically replace media_entity 1.x with 2.x. (Which seems endlessly confusing to me... why depend on 1.6 then patch it to 2.x - why not just use 2.x to begin with?)
In short, I believe that yes, the patch I provided should be made against 2.x.
Comment #5
sinn CreditAttribution: sinn at Adyax commentedIssue is in media_entity.drush.inc - function drush_media_entity_updatedb_validate() is invoked by drush even if media_entity is disabled.
Comment #6
sinn CreditAttribution: sinn at Adyax commentedQuick workaround is attached
Comment #7
balsama+1 to #6. This seems to be fixed in more recent versions of Drush (9.0.0-beta7 and beta8 at least) but is definitely reproducible using 8.1.15. We're pulling this into Lightning. Thanks.
Comment #8
marcoscanoComment #9
sinn CreditAttribution: sinn at Adyax commentedThanks. Tested with Drush 8.1.15 and Lightning 2.2.2-alpha2. It works now.
Comment #11
marcoscanoNormally you shouldn't RTBC your own patches, but in any case, for this particular problem, I believe we should fix after the Drush refactoring on #2916947: Make sure the upgrade path works with Drush 8 and Drush 9 lands.
Comment #12
marcoscano#6 doesn't apply anymore. This is just a re-roll with an improved documentation.
Comment #14
phenaproximaFixed on commit.
Patch makes perfect sense to me. Thanks, all!