Improve error handling and reliability on indexing

Created on 3 November 2017, over 6 years ago
Updated 12 April 2023, about 1 year ago

I added search api to an existing drupal 8 website which already has content migrated from a wordpress website. I tried indexing with both drush sapi-i and drush cron, it indexed some pages but than it stopped with the error:

LogicException: Could not determine image width for 'public://images/test.bmp' using image style with ID: example_style. This image style can
not be used for a responsive image style mapping using the 'sizes' attribute. in _responsive_image_build_source_attributes() (line 429 ...

Couldn't index items. Check the logs for details.

Both cron job and indexing where blocked from that point on.

Obviously this is not a Search API error, viewing the content was not possible neither – so it needed to be fixed anyway. But in first place it would be helpful if the content which causes the error would be ignored on following indexing attempts. That way there would be the chance to get most part of the site indexed and it will prevent the cron job from being stuck forever (or until the error get's discovered). The developer can come back and check which items couldn't be indexed and fix the problems without interferences on the rest of the site. In second place it would be very helpful to somehow see which entities couldn't be indexed (successfully).

It would be very helpful having a list of entities which failed completely to be indexed or where some problems occurred, like in another case:

Warning: While indexing items on search index Default content index, 1 item(s) did not have a view mode configured for one or more "Rendered item" fields.

Currently in both cases the entity in question does not show up in the error log, so some debugging efforts are necessary to find it. Would it be possible to log the entity type and id at least in the case where a recoverable error/warning occurs?

I don't know the insights of indexing. But I thought it might be possible before processing an entity to log id and type "somewhere". If a new index run encounters this entity in the log it could be skipped, as obviously something bad happened. It would be great if that log could be accessed from the status page to be informed. Could that be implemented as an index pre-processor? That way it could be disabled on sites where it won't be necessary and may harm performance.

✨ Feature request
Status

Postponed: needs info

Version

1.0

Component

General code

Created by

πŸ‡©πŸ‡ͺGermany osopolar πŸ‡©πŸ‡ͺ GER 🌐

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.

Production build 0.69.0 2024