Skip to content

Add error logging for silenced Elasticsearch exceptions#1298

Open
NAME-ASHWANIYADAV wants to merge 1 commit into
openml:developfrom
NAME-ASHWANIYADAV:fix/add-missing-exception-logging
Open

Add error logging for silenced Elasticsearch exceptions#1298
NAME-ASHWANIYADAV wants to merge 1 commit into
openml:developfrom
NAME-ASHWANIYADAV:fix/add-missing-exception-logging

Conversation

@NAME-ASHWANIYADAV

Copy link
Copy Markdown

Description

This PR resolves several maintainer TODOs by adding proper error logging to empty catch blocks that previously swallowed ElasticSearch exceptions silently.

Changes made:

  • Replaced empty catch blocks in API models (Api_data, Api_flow, Api_run, Api_study) with log_message('error', ...) calls.
  • Updated ElasticSearch.php to log exceptions alongside the existing echo statements.
  • Each log entry includes a component tag (e.g., [Api_data]), the entity type/ID, and the exception message.

Why this is needed:
When ElasticSearch indexing fails during entity uploads, the errors were previously ignored, making production debugging difficult. Logging these via CodeIgniter's built-in log_message ensures failures are captured in the configured log path (e.g., /var/www/openml/logs/).

Related Issues:
Fixes #1297

@NAME-ASHWANIYADAV

Copy link
Copy Markdown
Author

@joaquinvanschoren @janvanrijn PTAL!!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

backend: Add missing error logging for ElasticSearch indexing failures

1 participant