From 171414c3193d7d467a7e26103979540b8ebaac24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Sowi=C5=84ski?= Date: Tue, 19 Mar 2024 08:08:13 +0100 Subject: [PATCH 1/2] 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` --- x-pack/filebeat/input/gcs/scheduler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/filebeat/input/gcs/scheduler.go b/x-pack/filebeat/input/gcs/scheduler.go index c68c3123cf2..ea992b49924 100644 --- a/x-pack/filebeat/input/gcs/scheduler.go +++ b/x-pack/filebeat/input/gcs/scheduler.go @@ -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 From 26609d1ad7158905f232f26ede005bb11fee6b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Sowi=C5=84ski?= Date: Tue, 19 Mar 2024 12:04:33 +0100 Subject: [PATCH 2/2] Update CHANGELOG-developer.next.asciidoc --- CHANGELOG-developer.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-developer.next.asciidoc b/CHANGELOG-developer.next.asciidoc index 14901ead1bc..225dd028b9b 100644 --- a/CHANGELOG-developer.next.asciidoc +++ b/CHANGELOG-developer.next.asciidoc @@ -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