Skip to content

[8.17](backport #45128) [kafka] Handle configuration errors#45279

Closed
mergify[bot] wants to merge 6 commits into8.17from
mergify/bp/8.17/pr-45128
Closed

[8.17](backport #45128) [kafka] Handle configuration errors#45279
mergify[bot] wants to merge 6 commits into8.17from
mergify/bp/8.17/pr-45128

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Jul 10, 2025

Proposed commit message

This PR handles kafka configuration errors by dropping the message. Since configuration errors are of permanent error type and should not be retried.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

Bring kafka server up using following command

cd filebeat
mage docker:composeUp

Use following filebeat.yml

filebeat.inputs:
  - type: filestream
    id: filestream-input-id
    enabled: true
    paths:
      - ./test.log
    file_identity.native: ~
    prospector.scanner.fingerprint.enabled: false      

output:
  kafka:
    hosts: ["localhost:9092", "localhost:9094"]
    topic: beats
    max_message_bytes: 10

and you can see this error

{
  "log.level": "error",
  "@timestamp": "2025-07-02T15:28:04.373+0530",
  "log.logger": "kafka",
  "log.origin": {
    "function": "github.com/elastic/beats/v7/libbeat/outputs/kafka.(*msgRef).fail",
    "file.name": "kafka/client.go",
    "file.line": 396
  },
  "message": "Kafka (topic=beats): dropping message due to invalid configuration kafka: invalid configuration (Attempt to produce message larger than configured Producer.MaxMessageBytes: 851 > 10)",
  "service.name": "filebeat",
  "ecs.version": "1.6.0"
}

Related issues


This is an automatic backport of pull request #45128 done by [Mergify](https://mergify.com).

* [kafka] Handle configuration errors

(cherry picked from commit 23f4491)

# Conflicts:
#	libbeat/outputs/kafka/client.go
#	libbeat/outputs/kafka/kafka_integration_test.go
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Jul 10, 2025
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Jul 10, 2025

Cherry-pick of 23f4491 has failed:

On branch mergify/bp/8.17/pr-45128
Your branch is up to date with 'origin/8.17'.

You are currently cherry-picking commit 23f4491cc.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   libbeat/outputs/kafka/config.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   libbeat/outputs/kafka/client.go
	both modified:   libbeat/outputs/kafka/kafka_integration_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify Bot requested a review from a team as a code owner July 10, 2025 06:36
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Jul 10, 2025
@mergify mergify Bot requested review from AndersonQ and faec and removed request for a team July 10, 2025 06:36
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 10, 2025
@mergify mergify Bot mentioned this pull request Jul 10, 2025
6 tasks
@botelastic
Copy link
Copy Markdown

botelastic Bot commented Jul 10, 2025

This pull request doesn't have a Team:<team> label.

@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Jul 10, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/8.17/pr-45128 upstream/mergify/bp/8.17/pr-45128
git merge upstream/8.17
git push upstream mergify/bp/8.17/pr-45128

@khushijain21 khushijain21 enabled auto-merge (squash) July 10, 2025 13:24
@khushijain21
Copy link
Copy Markdown
Contributor

This bug was introduced after 8.17. Closing this backport

auto-merge was automatically disabled July 11, 2025 06:39

Pull request was closed

@mergify mergify Bot deleted the mergify/bp/8.17/pr-45128 branch July 11, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant