EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids()

Created on 6 February 2015, almost 10 years ago
Updated 12 November 2023, about 1 year ago

Hey!

After updating file_entity to 2.0-beta1 my Drupal sites started to throw this EntityMalformedException error. This is pretty bad since the site goes to error state after this. Clearing cache fixes this temporarily, but since I have to do that from drush this requires manual involvement from me every time. Clients aren't very happy.

This isn't at all consistent, it can go like couple of days w/o any errors, and then there can be a day like today, when the log fills with errors. I reuploaded some images to see if there was something in the image files themselves, but to no avail. I also have few sites using the same installation profile and it's consistent between those.

Also I'm on the omega8.cc aegir host if that could have something to do with this. But all this worked perfectly before the last update, and most of the images work perfectly, even the image on that entity where it's attached works just fine. I'm just not able to reproduce this in any other way than waiting that error to pop up and put my sites down.

I edited that entity_extract_ids() to print out debug_backtrace to dblog, to find out the cause of this. See attachment. It seems that it's from entitycache and file_entity. I also load some json feeds via services and sometimes I can see this backtrace in logs but this doesn't cause the whole site to go down.

I'm pretty much lost and out of options here, I have to try and go back to the alpha3 version and see if that works.

Cheers,

Janne

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇮Finland jiisuominen

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

Comments & Activities

Not all content is available!

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

  • 🇳🇱Netherlands TheoRichel

    Hello,

    I am having the same problem

    EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 8097 of /home/customer/www/theorichel.nl/public_html/includes/common.inc).

    and since this thread is years old, I do not know what to do. Apply patch 51?

    I am on D 7.98
    PHP 7.4.33
    File Entity 2.37
    Media 2.30

    Many thanks in advance.

  • 🇳🇱Netherlands TheoRichel

    I am applying the patch in #51 which wants me to remove several lines with the word 'recursive' in it but that word is not in the 2.37 v of the file, the word 'repeated' is. Which word should I use? 'Recursive' from the patch or should I replace that 'Recursive' from the patch with 'repeated'.?
    Thanks!

  • 🇬🇧United Kingdom rickj

    @TheoRichel

    This issue was raised against 7.x-2.0-beta3, the current version is 7.x-2.37. The fix here is already incorporated in 2.37, so the patch is not relevant. Are you running the latest version?

    It sounds to me that another bug may have crept in that's resulting in the same error message. It would be best to open a new issue, and describe how to replicate the problem.

  • 🇳🇱Netherlands TheoRichel

    I reposted: https://www.drupal.org/project/file_entity/issues/3401100 💬 EntityMalformedException: Missing bundle property Active
    Thanks

Production build 0.71.5 2024