Broken entities into my Elgg!!!

Hi,

Excuse me for my English, I will try to explain me so better be possible.

It is my problem: I am working with an Elgg 1.7.1 based platform, and putted on line, we found a database issue:

Records (in entities table) site type without his sites_entity table record.

In some records, his guid field value corresponds to an users_entity table record.

I have not found the problem source, what can be wrong, but I would know if this is an known elgg bug for 1.7.1 version, of someone had this experience or similar.

Best regards..!

  • Thanks for your comment,

    but I found these plugin, I need know what are broking my database. Each so time, new broken entities appears.

    If there are some bug into elgg engine code, I would do something to fix it.

  • What type of hosting you are using? and which all thirdparty plugins?

  • I am using an virutal server, without thirdparty plugins... In this case, we are working in reordering of the engine leaving only data access functions.

    I would know if someone experienced this issue... I think, may be known bug.

    To solve it, I repaired the database manually, but I cant measure damage caused by this error because for some situations I deleted broken entities from database. (entities record wihtout sites_entity, or users_entity table record).

    Since, so far I had no problems.. the system is working fine, but I would know about that was caused it, to prevent future damages....

    It is so strange...

  • I haven't used anything prior to 1.7.8 but I haven't had any issues with broken entities, and I doubt that's a core bug.  You'll need to be a bit more descriptive about what exactly is broken with the entities.

    Records (in entities table) site type without his sites_entity table record.

    Not sure what you mean there...

    In some records, his guid field value corresponds to an users_entity table record.

    This is normal.  A user is an entity, and will have a guid that is registered in the entities table.

     

    In this case, we are working in reordering of the engine leaving only data access functions.

    So you've made changes to the core code of Elgg?  That would be the first place I would look for any problems.

  • Thanks,

    Ok, I will try to explain me better...

    First,

    Records (in entities table) site type without his sites_entity table record.

    It means that when I  try to call elgg_get_entities(array('type'=>'site')); an error occurs. It because Elgg get the record from entities table, but when try to get the record from sites_entity table, it has been deleted, or has not created... then can't do an array_merge($entities_record, null).... To fix it, I must delete the entities table record, or set to enabled=no, or manually create sites_entity record... (invent..!)

    In some records, his guid field value corresponds to an users_entity table record.

    In this case, I get using SQL sites broken, like as previous explanation... But, the guid entity I can found in users_entity table!!!.. Then I think: "something has changed type value in entities table"... but... how? I dont understand it.. Bad manipulation? Manteinance operations? I dont know. I am in investigation, each time, some entities appears broken....

     

    In this case, we are working in reordering of the engine leaving only data access functions.

    Really, I doubt that an error can be originated by reordering. When I say "reordering", it means that I leave only data access functions.. For example: elgg_get_entityes(), get_entity(), crate_entity(), update_entity(), delete_entity(),.... for entities, objects, users, sites, groups, metadata, private settings, and annotations....

     

    If Dbvalidator plugin exists, it means that elgg have some problems with the database.

    A imporant point is that the database havent how ensure referential integrity, like foreign keys, indexes, transactions, etc... Try to ensure referential integrity by php code, is not a good idea... O.O ---

     

    Regards...

     

  • I just tested both cases on my installation and there's no break.

    In fact the plugin I'm working on right now uses elgg_get_entities('types' => array('user')) with perfect results.

    All I can suggest is making a clean install and testing on that, then looking for the differences.  Not much else I can tell you, good luck!

  • ok... no problem.. thanks for your time...

    I will go on investigation...

    If I found any bug, I will want to report to community!!

    Regards!