Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-18217

Search crashes when solr index is out of sync with ezp db

    XMLWordPrintable

Details

    Description

      When a Solr index contains an object that doesn't exist in the eZ Publish database, and this object is returned in a search result, eZ Publish crashes.

      The eZFindResultNode for the bad result is created, but its eZContentObjectTreeNode properties are mostly NULL. The search result listing crashes on eZContentObjectTreeNode::className() because the class cannot be fetched, ending in a "Call to a member function attribute() on a non-object" at this line:

      $class = $object->contentClass();
      $this->ClassName = $class->attribute( 'name' );
      

      Having the index out of sync is an error situation of itself, but eZ Find should handle it better. It should not return these cases as search results, but rather remove them from the results and log the error.

      Steps to reproduce

      How to get the index out of sync (untested, not sure if this works):

      • Create an article, make sure it is indexed
      • Stop ezfind
      • Delete the article

      Test the issue:

      • Restart ezfind
      • Search for the deleted object

      Attachments

        Activity

          People

            jv@ez.no jv@ez.no
            gl gl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: