-
Notifications
You must be signed in to change notification settings - Fork 636
curator_cli forcemerge exception #1704
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
Labels
Comments
untergeek
added a commit
to untergeek/curator
that referenced
this issue
Apr 1, 2025
Replace: ``` action.do_singleton_action(dry_run=ctx.obj['dry_run']) ``` With: ``` try: action.do_singleton_action(dry_run=ctx.obj['dry_run']) except NoIndices: # Speficically to address elastic#1704 action.logger.info('No indices in list after filtering. Skipping action.') ```
untergeek
added a commit
to untergeek/curator
that referenced
this issue
Apr 1, 2025
This here addresses the problem in elastic#1704 ```diff --- a/curator/cli_singletons/object_class.py +++ b/curator/cli_singletons/object_class.py @@ -262,7 +262,11 @@ class CLIAction: action_obj.do_dry_run() else: action_obj.do_action() - + except NoIndices: # Speficically to address elastic#1704 + if not self.ignore: + self.logger.critical('No indices in list after filtering. Exiting.') + sys.exit(1) + self.logger.info('No indices in list after filtering. Skipping action.') except Exception as exc: self.logger.critical( 'Failed to complete action: %s. Exception: %s', self.action, exc ```
untergeek
added a commit
to untergeek/curator
that referenced
this issue
Apr 1, 2025
This also demonstrates what happened with elastic#1704 and that this resolves it. Two extra tests. One to test with `--ignore_empty_list` and one without that flag.
untergeek
added a commit
to untergeek/curator
that referenced
this issue
Apr 1, 2025
8.0.21 (1 April 2025) --------------------- **Bugfix Release** As was reported in elastic#1704, the ``--ignore_empty_list`` option was not being respected. Code changes were made to each singleton that uses the ``--ignore_empty_list`` option to ensure that the option is respected. **Changes** * Fix ``--ignore_empty_list`` option to be respected in all singletons. * Add debug message to IndexList class when an empty list condition is encountered. * Dependency version bump: ``es_client`` to ``8.17.5``
I finally took the time to resolve this. A release should be out later today. |
untergeek
added a commit
that referenced
this issue
Apr 1, 2025
* Add debug log message on empty index list * Add NoIndices try/except catch block This here addresses the problem in #1704 ```diff --- a/curator/cli_singletons/object_class.py +++ b/curator/cli_singletons/object_class.py @@ -262,7 +262,11 @@ class CLIAction: action_obj.do_dry_run() else: action_obj.do_action() - + except NoIndices: # Speficically to address #1704 + if not self.ignore: + self.logger.critical('No indices in list after filtering. Exiting.') + sys.exit(1) + self.logger.info('No indices in list after filtering. Skipping action.') except Exception as exc: self.logger.critical( 'Failed to complete action: %s. Exception: %s', self.action, exc ``` * Add tests for forcemerge to test the fix This also demonstrates what happened with #1704 and that this resolves it. Two extra tests. One to test with `--ignore_empty_list` and one without that flag. * Version bump for es_client Now at 8.17.5 * Version bump to 8.0.21 * Update Changelog 8.0.21 (1 April 2025) --------------------- **Bugfix Release** As was reported in #1704, the ``--ignore_empty_list`` option was not being respected. Code changes were made to each singleton that uses the ``--ignore_empty_list`` option to ensure that the option is respected. **Changes** * Fix ``--ignore_empty_list`` option to be respected in all singletons. * Add debug message to IndexList class when an empty list condition is encountered. * Dependency version bump: ``es_client`` to ``8.17.5``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue has already been discussed on the Elastic forum: https://discuss.elastic.co/t/curator-forcemerge-exception/354245
To submit a bug or report an issue
I've discovered that the current version of curator_cli (version 8.0.10) will throw an Exception on forcemerge when the index in question is already at/below the requested number of segments per shard.
Expected Behavior
The curator_cli program should filter out indices as candidates to forcemerge when they are already at/below the requested number of segments per shard.
Actual Behavior
The curator_cli program throws an exception and exits with a nonzero exit code when the specified index already has the requested number of segments per shard.
Steps to Reproduce the Problem
Specifications
Context (Environment)
I have a script that runs nightly to forcemerge cold indices down to a single segment. It depends on script exit codes to check for errors/issues with Elastic index processed. Per the discussion in the Elastic forum (see the link at the beginning of this issue), I'm putting in a feature request to ask that curator_cli not error out on indices that are already at or below the requested number of segments per shard.
The text was updated successfully, but these errors were encountered: