Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when jaeger-tags value is set to env var without default value #1776

Closed
jpkrohling opened this issue Sep 6, 2019 · 1 comment · Fixed by #1777
Closed

Panic when jaeger-tags value is set to env var without default value #1776

jpkrohling opened this issue Sep 6, 2019 · 1 comment · Fixed by #1777
Assignees

Comments

@jpkrohling
Copy link
Contributor

When using the --jaeger-tags flag with a value being set by env vars, the agent crashes when no default value is specified. Example:

--jaeger.tags=key=value,envVar1=${envKey1:defaultVal1},envVar2=${envKey2:defaultVal2},envVar3=${envKey3}

The Jaeger Agent will crash when parsing the value for envKey3, as it expects a default value to exist:

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/jaegertracing/jaeger/cmd/agent/app/reporter.parseAgentTags(0x7ffd2b4197bb, 0x69, 0xb)
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/cmd/agent/app/reporter/flags.go:72 +0x430
github.com/jaegertracing/jaeger/cmd/agent/app/reporter.(*Options).InitFromViper(0xc000127af0, 0xc0000b2900, 0x5)
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/cmd/agent/app/reporter/flags.go:55 +0x9e
main.main.func1(0xc0001d0a00, 0xc00016bc20, 0x0, 0x3, 0x0, 0x0)
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/cmd/agent/main.go:59 +0x121
github.com/jaegertracing/jaeger/vendor/github.com/spf13/cobra.(*Command).execute(0xc0001d0a00, 0xc000092010, 0x3, 0x3, 0xc0001d0a00, 0xc000092010)
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/vendor/github.com/spf13/cobra/command.go:762 +0x465
github.com/jaegertracing/jaeger/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0001d0a00, 0xc0001d0a00, 0xc000127f60, 0x5)
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/vendor/github.com/spf13/cobra/command.go:852 +0x2ec
github.com/jaegertracing/jaeger/vendor/github.com/spf13/cobra.(*Command).Execute(...)
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/vendor/github.com/spf13/cobra/command.go:800
main.main()
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/cmd/agent/main.go:101 +0x3e8
@jpkrohling
Copy link
Contributor Author

A workaround is to simply add : to the notation, like: ${envKey3:}, instead of ${envKey3}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant