Skip to content

Commit

Permalink
Filebeat gcs input addFiledJobs panic protection (#38407)
Browse files Browse the repository at this point in the history
* Filebeat gcs input addFiledJobs panic protection

In case `obj, err := s.bucket.Object(name).Attrs(ctx)` return an error, obj will be probably `nil` in consequence the code below will panic
`objectURI := "gs://" + s.src.BucketName + "/" + obj.Name`

* Update CHANGELOG-developer.next.asciidoc

(cherry picked from commit c6fd99c)
  • Loading branch information
adassow authored and mergify[bot] committed Mar 20, 2024
1 parent df06d9f commit 350943f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The list below covers the major changes between 7.0.0-rc2 and main only.
- Make winlogbeat/sys/wineventlog follow the unsafe.Pointer rules. {pull}36650[36650]
- Cleaned up documentation errors & fixed a minor bug in Filebeat Azure blob storage input. {pull}36714[36714]
- Fix copy arguments for strict aligned architectures. {pull}36976[36976]
- Fix filebit gcs input panic {pull}38407[38407]

==== Added

Expand Down
1 change: 1 addition & 0 deletions x-pack/filebeat/input/gcs/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ func (s *scheduler) addFailedJobs(ctx context.Context, jobs []*job) []*job {
obj, err := s.bucket.Object(name).Attrs(ctx)
if err != nil {
s.log.Errorf("adding failed job %s to job list caused an error: %w", err)
continue
}

objectURI := "gs://" + s.src.BucketName + "/" + obj.Name
Expand Down

0 comments on commit 350943f

Please sign in to comment.