Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-30664: Skipped indexing erroneous Content and logged all exceptions #139

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

SerheyDolgushev
Copy link
Contributor

@SerheyDolgushev SerheyDolgushev commented May 27, 2019

Jira: https://jira.ez.no/browse/EZP-30664
Target version: 1.5 (eZ Platform 1.7+)

Continue to index other content in the iteration when an exception happens.

@andrerom
Copy link
Contributor

andrerom commented Jun 3, 2019

@SerheyDolgushev what kind of exception are you having issues with? aka could you expand on the issue / motivation for the change here? (ideally in JIRA ticket, and link here)

@SerheyDolgushev
Copy link
Contributor Author

SerheyDolgushev commented Jun 11, 2019

Few strange scenarios:

  1. Trying to index a field type without indexable:
[2019-06-10 22:13:29] console.ERROR: Error thrown while running command "ezplatform:reindex --content-ids='35617,35618,35619,35620,35622,35624,35625,35627,35629,35630,35631,35632,35633,35634,35635,35637,35638,35639,35640,35641,35642,35643,35644,35645,35646,35648,35650,35655,35660,35664,35665,35667,35669,35676,35677,35680,35681,35684,35686,35688,35691,35692,35693,35694,35695,35696,35697,35700,35701,35702' --env=dev". Message: "No type registered for ezbotrvideo." {"exception":"[object] (OutOfBoundsException(code: 0): No type registered for ezbotrvideo. at /Users/sd/Projects/XXX/platform/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Search/Common/FieldRegistry.php:58)","command":"ezplatform:reindex --content-ids='35617,35618,35619,35620,35622,35624,35625,35627,35629,35630,35631,35632,35633,35634,35635,35637,35638,35639,35640,35641,35642,35643,35644,35645,35646,35648,35650,35655,35660,35664,35665,35667,35669,35676,35677,35680,35681,35684,35686,35688,35691,35692,35693,35694,35695,35696,35697,35700,35701,35702' --env=dev","message":"No type registered for ezbotrvideo."} []
  1. Trying to index the content with invalid RichText field:
[2019-06-10 21:53:51] console.ERROR: Error thrown while running command "ezplatform:reindex --content-ids='4,10,11,12,13,14,41,42,45,49,50,51,52,54,56,57,104,105,506,507,508,509,514,518,519,520,523,524,525,526,527,528,529,530,531,533,534,535,536,539,541,543,545,547,548,551,553,555,557,558' --env=dev". Message: "Warning: DOMDocument::loadXML(): Entity 'nbsp' not defined in Entity, line: 1" {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\ContextErrorException(code: 0): Warning: DOMDocument::loadXML(): Entity 'nbsp' not defined in Entity, line: 1 at /Users/sd/Projects/XXX/platform/vendor/ezsystems/ezplatform-richtext/src/lib/eZ/FieldType/RichText/RichTextStorage.php:131)","command":"ezplatform:reindex --content-ids='4,10,11,12,13,14,41,42,45,49,50,51,52,54,56,57,104,105,506,507,508,509,514,518,519,520,523,524,525,526,527,528,529,530,531,533,534,535,536,539,541,543,545,547,548,551,553,555,557,558' --env=dev","message":"Warning: DOMDocument::loadXML(): Entity 'nbsp' not defined in Entity, line: 1"} []

And there might be more strange cases

@SerheyDolgushev
Copy link
Contributor Author

Without this PR, if there is a problematic content in the indexing batch (50 items) - indexing for this batch will be stopped. With this PR problematic content will be ignored (an error will be logged) but the rest content will be indexed.

@andrerom
Copy link
Contributor

@alongosz The two cases are:

  • OutOfBoundsException : No type registered for ezbotrvideo.
  • Warning: DOMDocument::loadXML(): Entity 'nbsp' not defined in Entity, line: 1"

Should we change interface to state exceptions will be skipped but logged, or do we add exceptions for these cases and document those will be handled?

@alongosz
Copy link
Member

Should we change interface to state exceptions will be skipped but logged, or do we add exceptions for these cases and document those will be handled?

If I get it right, the possibilities here are actually limitless due to custom Field Type implementations, so I would log all exceptions and skip.

@SerheyDolgushev
Copy link
Contributor Author

As this PR does :)

@alongosz
Copy link
Member

@SerheyDolgushev you'll probably need to rebase it to at least branch 1.6 to have it in 2.5.x LTS. Fixing this for master will get you that fix in eZ Platform 3.0 ;)
If the bug occurs on some older LTS, like 1.7 or 1.13, please let me know.

@SerheyDolgushev SerheyDolgushev changed the base branch from master to 1.6 June 11, 2019 15:08
@SerheyDolgushev
Copy link
Contributor Author

@alongosz rebased against 1.6

@alongosz alongosz changed the title Don't break IncrementalIndexer::createSearchIndex on first exception Skipped indexing erroneous Content and logged all exceptions Jun 11, 2019
@andrerom
Copy link
Contributor

@SerheyDolgushev Do you have a Jira ticket for this as well? ;)

@SerheyDolgushev
Copy link
Contributor Author

Done: https://jira.ez.no/browse/EZP-30664
@andrerom please let me know if something else is required.
BTW, I`m going to submit the same PR for a legacy search.

@andrerom
Copy link
Contributor

@alongosz given this is bug fix I'd like this on 1.5 and kernel on 6.7, ok? Otherwise we will surely face this coming in via support in the near feature anyway ;)

@andrerom andrerom changed the title Skipped indexing erroneous Content and logged all exceptions EZP-30664: Skipped indexing erroneous Content and logged all exceptions Jun 17, 2019
@SerheyDolgushev SerheyDolgushev changed the base branch from 1.6 to 1.5 June 19, 2019 16:19
@SerheyDolgushev
Copy link
Contributor Author

@andrerom @alongosz rebased against 1.5

@alongosz alongosz added the Bug label Jun 19, 2019
@andrerom

This comment has been minimized.

@andrerom
Copy link
Contributor

andrerom commented Jan 8, 2020

@alongosz On closer look, isn't this doing exactly the same as PR from @kmadejski that goes further on this? #122

Ignore, this also covers cases where for instance field types are missing. So this should be done regardlessly of that. Sending to QA.

@micszo micszo self-assigned this Feb 19, 2020
@micszo
Copy link
Member

micszo commented Feb 20, 2020

@andrerom
Copy link
Contributor

I suppose this Travis failure is not related to the changes, right?

correct, it's something to do with travis, composer or both. Restarted it, but if it still fails it's a clue we need to do some fixes on the branches here to adapt for changes in travis / composer.

Copy link
Member

@micszo micszo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Approved on eZ Studio v1.13.5 & eZ Platform EE 2.5 with Solr.

@micszo micszo removed their assignment Feb 20, 2020
@lserwatka lserwatka merged commit 14fde41 into ezsystems:1.5 Feb 20, 2020
@lserwatka
Copy link
Member

@alongosz could you merge it up?

@alongosz
Copy link
Member

Merged up to 1.6 as 7521c57, 1.7 as 3d360d2, 2.0 as c409744, and master (3.0@dev) as 1d9e300.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants