Improve error handling for Solr failures in dataone-indexer

Open
#240 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
backend, search

Research direction

Start with IndexWorker:indexObject and HTTPService:sendUpdate, the entry points named in the example stack traces, and trace how unreachable Solr, non-200 responses, and missing component IDs are handled. Review the reported failure cases and define an explicit retry, status, ordering, and user-feedback behavior; done means failed indexing is no longer silent or leaves datasets appearing broken.

Written by the indexing model from the issue text.

Description

Problem

Currently, the dataone-indexer does not robustly handle failures when it cannot update Solr. When the indexer encounters an error (such as Solr being unreachable, a non-200 HTTP response, or missing component IDs), it simply fails silently. As a result, datasets can appear broken in the UI after a user saves them (e.g., missing resource maps), causing confusion and potentially impacting data integrity and discoverability.

Example Errors

dataone-indexer 20250522-16:07:00: [ERROR]: Cannot index the task for identifier ess-dive-16a147be33ae867-20250522T160057790 since ess-dive-solr-20250514-headless: Temporary failure in name resolution [org.dataone.cn.indexer.IndexWorker:indexObject:486]
[org.dataone.cn.indexer.solrhttp.HTTPService:sendUpdate:128]

2025-05-22T17:43:52.563136477Z dataone-indexer 20250522-17:43:52: [ERROR]: Cannot index the task for identifier ess-dive-7437c9c521814a2-20250522T173903944 since unable to update solr, non 200 response code. { "status":500, "error":{"root-error-class":"org.apache.zookeeper.KeeperException$SessionExpiredException"}} 

2025-05-22T17:19:42.164060793Z dataone-indexer 20250522-17:19:42: [ERROR]: Cannot index the task for identifier ess-dive-a6017243efc80c5-20250522T171913973 since Solr index doesn't have the information about the id ess-dive-16a147be33ae867-20250522T160057790 which is a component in the resource map ess-dive-a6017243efc80c5-20250522T171913973. Metacat-Index can't process the resource map prior to its components. [org.dataone.cn.indexer.IndexWorker:indexObject:486]
...

Desired Behavior

  • Solr indexing failures should not result in datasets being left in a broken state in the UI.
  • The indexer should implement better error handling, such as:
    • Retrying failed Solr updates with exponential backoff.
    • Marking datasets with an explicit error or pending status if indexing fails.
    • Logging actionable errors and optionally notifying users/admins about indexing issues.
    • Ensuring resource maps are only processed after all components have been indexed successfully.
  • Users should receive clear feedback if their dataset is not fully indexed due to backend issues, rather than the dataset appearing as missing or broken.

Impact

Improved error handling for Solr interactions in the dataone-indexer will reduce user confusion, preserve data integrity, and help maintain trust in the system when backend issues occur.


Filed by: @vchendrix
Date: 2025-05-22

Dominant language
Java
Stars
0
Forks
2
Avg merge
6d 6h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataONEorg/dataone-indexer

All issues in DataONEorg/dataone-indexer

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.