FTBFS - FAIL: TestTimezoneAmericasCompileFileAndParse

Bug #2061991 reported by Miriam España Acebal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
telegraf (Ubuntu)
In Progress
Undecided
Miriam España Acebal

Bug Description

In a recent rebuild on the server team, amd64 arm64 ppc64el s390x arch builds were failing due to:

2024/04/16 20:54:12 E! [] Error parsing foobar to timestamp: strconv.ParseInt: parsing "foobar": invalid syntax
2024/04/16 20:54:12 E! [] Error parsing foobar to int: strconv.ParseInt: parsing "foobar": invalid syntax
2024/04/16 20:54:12 E! [] Error parsing timestamp [foobar], could not find any suitable time layouts.
2024/04/16 20:54:12 D! [] Grok no match found for: "1.25 200 192.168.1.1 5.432µs"
2024/04/16 20:54:12 D! [] Grok no match found for: "[04/Jun/2016:12:41:45 +0100] notnumber 200 192.168.1.1 5.432µs 101"
2024/04/16 20:54:12 E! [] Error parsing notnumber to int: strconv.ParseInt: parsing "notnumber": invalid syntax
2024/04/16 20:54:12 E! [] Error parsing notnumber to float: strconv.ParseFloat: parsing "notnumber": invalid syntax
2024/04/16 20:54:12 E! [] Error parsing notnumber to duration: time: invalid duration "notnumber"
2024/04/16 20:54:12 E! [] Error parsing notnumber to duration: time: invalid duration "notnumber"
2024/04/16 20:54:12 W! [] Improper timezone supplied (Something/Weird), setting loc to UTC
--- FAIL: TestTimezoneAmericasCompileFileAndParse (0.01s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
 panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x6b2066]

goroutine 82 [running]:
testing.tRunner.func1.2({0x6f49a0, 0x9ba620})
 /usr/lib/go-1.22/src/testing/testing.go:1631 +0x24a
testing.tRunner.func1()
 /usr/lib/go-1.22/src/testing/testing.go:1634 +0x377
panic({0x6f49a0?, 0x9ba620?})
 /usr/lib/go-1.22/src/runtime/panic.go:770 +0x132
github.com/influxdata/telegraf/plugins/parsers/grok.(*Parser).Compile(0xc00013fe70)
 /<<PKGBUILDDIR>>/plugins/parsers/grok/parser.go:184 +0x8a6
github.com/influxdata/telegraf/plugins/parsers/grok.TestTimezoneAmericasCompileFileAndParse(0xc000456820)
 /<<PKGBUILDDIR>>/plugins/parsers/grok/parser_test.go:911 +0x10a
testing.tRunner(0xc000456820, 0x7722a0)
 /usr/lib/go-1.22/src/testing/testing.go:1689 +0xfb
created by testing.(*T).Run in goroutine 1

A debugging session shows that the improper timezone supplied is

error(*errors.errorString) *{s: "unknown time zone Canada/Eastern"}

From

grok.(*Parser).Compile (/media/miriam/extension/Code/packages/telegraf/telegraf-gu/plugins/parsers/grok/parser.go:182)

it tries to load /usr/share/zoneinfo//Canada/Eastern which doesn't exist , via time.LoadLocation -> loadTzinfo -> loadTzinfoFromDirOrZip

That file exists in tzdata-legacy package:

root@Ntzdata:~# apt-file search Canada/Eastern
Finding relevant cache files to search
tzdata-legacy: /usr/share/zoneinfo/Canada/Eastern
tzdata-legacy: /usr/share/zoneinfo/right/Canada/Eastern

It might be possible that we need to add tzdata-legacy as a dependency

Tags: ftbfs

Related branches

Changed in telegraf (Ubuntu):
assignee: nobody → Miriam España Acebal (mirespace)
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.