Skip to content

[export-log] Fix false "No log events in the log group" error on log export - #7571

Open
hanwen-cluster wants to merge 1 commit into
aws:developfrom
hanwen-cluster:developaug19
Open

[export-log] Fix false "No log events in the log group" error on log export#7571
hanwen-cluster wants to merge 1 commit into
aws:developfrom
hanwen-cluster:developaug19

Conversation

@hanwen-cluster

@hanwen-cluster hanwen-cluster commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description of changes

Prior to this commit, validation error of "no log events" is triggered whenever the first FilterLogEvents call came back with an empty events list. FilterLogEvents is paginated, so a page can be empty even when if more data is available in the next pages.

This commit triggers the validation error only if both events list and nextTokens are empty. Even though the existence of nextTokens doesn't guarantee the log is non-empty, this commit still makes a single API call for validation

Tests

Manually tested the following:

  1. Created a cluster on Aug 19
  2. Export the log with --start-time 2026-08-12T00:00:00Z --end-time 2026-08-20T00:00:00Z. Logs are successfully exported. This was the case where the "no log events" error was falsely reported
  3. Export the log with --start-time 2026-08-12T00:00:00Z --end-time 2026-08-18T00:00:00Z, "no log events" error was correctly reported

References

  • Link to impacted open issues.
  • Link to related PRs in other packages (i.e. cookbook, node).
  • Link to documentation useful to understand the changes.

Checklist

  • Make sure you are pointing to the right branch.
  • If you're creating a patch for a branch other than develop add the branch name as prefix in the PR title (e.g. [release-3.6]).
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

Please review the guidelines for contributing and Pull Request Instructions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…export

Prior to this commit, validation error of "no log events" is triggered whenever the first FilterLogEvents call came back with an empty events list. FilterLogEvents is paginated, so a page can be empty even
when if more data is available in the next pages.

This commit triggers the validation error only if both events list and `nextTokens` are empty
@hanwen-cluster
hanwen-cluster requested review from a team as code owners August 19, 2026 19:21
@hanwen-cluster hanwen-cluster added the skip-changelog-update Disables the check that enforces changelog updates in PRs label Aug 19, 2026
kwargs["endTime"] = end_time
if log_stream_name_prefix:
kwargs["logStreamNamePrefix"] = log_stream_name_prefix
return self._client.filter_log_events(**kwargs).get("events")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The return value of the function has to be changed, so the caller of this function has info on both event list and nextToken

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

Labels

skip-changelog-update Disables the check that enforces changelog updates in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant