Closed (fixed)
Project:
Entity Embed
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Oct 2017 at 16:54 UTC
Updated:
11 Jun 2026 at 07:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Ralf Eisler commentedGot the same error message here:
Drupal\entity_embed\Exception\EntityNotFoundException: Unable to load embedded media entity 3aaa056f-dd95-418c-94c2-a34f990fc2cb. in Drupal\entity_embed\Plugin\Filter\EntityEmbedFilter->process() (line 161 of /home/mywebsite.com/docroot/modules/contrib/entity_embed/src/Plugin/Filter/EntityEmbedFilter.php).
Comment #3
mpark commentedComment #4
mpark commentedHi guys, any solution? What about 8.4. core, can I use this module still or jump to core media?
Comment #5
stockticker commentedI was trying to reproduce this, however things work fine on my 8.4 site.
However, I did a clean install, so it could be, that bug appear after upgrade to 8.4
Comment #6
mpark commentedHi. You are right, could be after upgrade only, but what we can do it in the running websites?
Mark
Comment #7
stockticker commentedI would try to debug, to find out why it's actually get no $entity on line 119 in EntityEmbedFilter.php - for me it would be starting point.
Comment #8
bronk commentedGetting this as well. Coming from a route not working though and then a 404 where it's trying to load a missing file. I would definitely start on line 95 of EntityEmbedFilter to find out where it's coming from.
Comment #9
heymo commentedSame issue here. Given that this is a 4 months old topic, has anybody found the cause of this yet?
Comment #10
ktch_my commentedGet this as well, after upgrade Drupal core from 8.4 to 8.5.
Comment #11
gngn commentedI'm getting this too.
Might be a user embedded an existing enity which was later deleted - but is still referenced via entity_embed.
In my case the error is triggered by search cron indexing nodes (which can have embedded entities) - so I do not know which drupal node is responsible.
Is there any possibility to get the embedding entity in EntityEmbedFilter::process() to debug further?
Comment #12
wim leersThis sounds highly likely. It'd be great if somebody could confirm this.
Comment #13
gngn commentedIf somebody could point me to any possibility to get the embedding entity in EntityEmbedFilter::process() I could debug further
(and maybe confirm the thought from #11).
Comment #14
wim leers@gngn: you can't really "get" it in that context, since a filter plugin only receives the text to filter, not the entity whose text it is (since an entity is not required to use the filter system). So if you want the embedding entity, then it's best to just put a breakpoint in place, and manually load the embedding entity, and go from there.
Comment #15
wim leersComment #16
gngn commentedI managed to fix my problem "manually".
In my case it was indeed a (later on deleted) media inserted in a WYSIWYG field via entity_embed.
In case anyone is interested, that's what I did:
drush sql-dump --ordered-dump > dump.sqlThis results in one-line-per-insert statements
grep 'ec06e3d8-1995-48e6-9173-4b40bca7e2ca' dump.sqlINSERT INTO `paragraph__field_text` VALUES ('pt_text',0,34260,34276,'en',0,'[...] <drupal-entity data-embed-button=\"embed_document\" data-entity-embed-display=\"view_mode:media.download\" data-entity-type=\"media\" data-entity-uuid=\"ec06e3d8-1995-48e6-9173-4b40bca7e2ca\"></drupal-entity>[...]'so it was a paragraph field.
<drupal-entity...</drupal-entity>, change back to my restricted filter format and savethank you - and I'm hoping for a way to see a missing media in the editor (2982322...
Comment #17
wim leersThanks for confirming! Thank you very much for taking the time to not only investigate how to prove this, but then also document the steps! This is super super super valuable. THANK YOU! 👏
The ideal solution here would be to have usage tracking and then forbid deleting a
Mediaentity if it has any usages. But there's a super complex cluster of critical Drupal core issues wrt usage tracking. So we shouldn't block ourselves on that. So yes, this just further confirms the need for #2982322: Mark missing embedded entities in WYSIWYG!I'm marking this issue fixed and using #16 + the analysis in this comment to elevate the priority of #2982322: Mark missing embedded entities in WYSIWYG. I'll also make sure you are credited on that issue for your research!
Comment #19
kuldeepbarot commentedComment #20
kuldeepbarot commentedRe-rolled patch #19 for 8.x-1.7