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: required envvar is unset (ROLLBAR_TOKEN) #7

Closed
vielmetti opened this issue Apr 3, 2020 · 9 comments
Closed

panic: required envvar is unset (ROLLBAR_TOKEN) #7

vielmetti opened this issue Apr 3, 2020 · 9 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. size/S estimate of the amount of work to address the issue
Projects

Comments

@vielmetti
Copy link

Successful build on Ubuntu 18.04 for aarch64 under WSL, but when I follow the instructions in the README I get this:

ed@iyengar:~/src/github.com/tinkerbell/boots$ ./boots
{"level":"panic","ts":1585923538.9905274,"caller":"rollbar/rollbar.go:20","msg":"required envvar is unset","service":"github.com/tinkerbell/boots","pkg":"log","envvar":"ROLLBAR_TOKEN"}
panic: required envvar is unset

goroutine 1 [running]:
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0x4000204000, 0x400016a300, 0x1, 0x2)
        /home/ed/go/pkg/mod/go.uber.org/zap@v1.10.0/zapcore/entry.go:229 +0x40c
go.uber.org/zap.(*SugaredLogger).log(0x40001b0018, 0x4, 0x641d77, 0x18, 0x0, 0x0, 0x0, 0x40000e9a78, 0x2, 0x2)
        /home/ed/go/pkg/mod/go.uber.org/zap@v1.10.0/sugar.go:234 +0xd4
go.uber.org/zap.(*SugaredLogger).Panicw(...)
        /home/ed/go/pkg/mod/go.uber.org/zap@v1.10.0/sugar.go:204
github.com/packethost/pkg/log/internal/rollbar.Setup(0x40001b0018, 0x64397e, 0x1b, 0x2)
        /home/ed/go/pkg/mod/github.com/packethost/pkg@v0.0.0-20190715213007-7c3a64b4b5e3/log/internal/rollbar/rollbar.go:20 +0x3a8
github.com/packethost/pkg/log.configureLogger(0x40001a0120, 0x64397e, 0x1b, 0x633420, 0x4, 0x632e61, 0x3, 0x633eef, 0x5)
        /home/ed/go/pkg/mod/github.com/packethost/pkg@v0.0.0-20190715213007-7c3a64b4b5e3/log/log.go:69 +0x1c8
github.com/packethost/pkg/log.Init(0x64397e, 0x1b, 0x0, 0x0, 0x0, 0x0, 0x400008b838, 0x0)
        /home/ed/go/pkg/mod/github.com/packethost/pkg@v0.0.0-20190715213007-7c3a64b4b5e3/log/log.go:87 +0xd4
main.main()
        /home/ed/src/github.com/tinkerbell/boots/main.go:41 +0xb8
@vielmetti vielmetti changed the title panic: required rollbar token is unset panic: required envvar is unset Apr 3, 2020
@parauliya
Copy link
Contributor

@vielmetti , boots runs in a docker container and while starting a container with boots image we take care of all the environment variables which are required to run the boots binary. Please refer docker-compose.yml file in tink repo to know all the envs which are required to run boots docker image.

@gauravgahlot
Copy link
Contributor

@vielmetti @parauliya Considering the scenario where a user may not want to use Docker for the whole provisioned setup, I think it would be nice to have a list of all the environment variables.

We can have a list of environment variables required for each application to be ready, in the README. And, it would be nice if we can briefly mention what each is required for.

@alexellis
Copy link

I ran into this too when testing this morning.

Maybe this requirement changed after the README was written? I'd suggest giving a sample that works in the README, even if the context for the env-var choices are written up somewhere else.

@alexellis
Copy link

@parauliya the documentation doesn't mention a Docker container, so my understanding from the README is that it should run outside, otherwise the README should prefix the instructions with docker run golang:latest or similar before having us install git-lfs.

@nathangoulding do you see a path for usage inside and outside of the container, or should users only use compose?

@alexellis
Copy link

I tried copying the instructions from https://github.com/tinkerbell/boots/blob/9d6cded511d1e7678ec601a29aac4137f25ecb5a/installers/rancher/main_test.go, but got as far as:

ROLLBAR_DISABLE=1 API_AUTH_TOKEN=token API_CONSUMER_TOKEN=test1234 PACKET_VERSION=0 PACKET_VERSION=0 PACKET_ENV=test ROLLBAR_TOKEN=1 ./boots 
{"level":"info","ts":1586167193.6481194,"caller":"boots/main.go:54","msg":"starting","service":"github.com/tinkerbell/boots","pkg":"main","version":"unknown (use make)"}
{"level":"error","ts":1586167193.6482196,"caller":"boots/main.go:58","msg":"FACILITY_CODE env must be set","service":"github.com/tinkerbell/boots","pkg":"main","error":"FACILITY_CODE env must be set","errorVerbose":"FACILITY_CODE env must be set\ngithub.com/tinkerbell/boots/packet.NewClient\n\t/home/alex/go/src/github.com/tinkerbell/boots/packet/client.go:42\nmain.main\n\t/home/alex/go/src/github.com/tinkerbell/boots/main.go:56\nruntime.main\n\t/usr/lib/go/src/runtime/proc.go:203\nruntime.goexit\n\t/usr/lib/go/src/runtime/asm_amd64.s:1373"}
panic: FACILITY_CODE env must be set

goroutine 1 [running]:
github.com/packethost/pkg/log.Logger.Fatal(0xa96141, 0x1b, 0xc000010058, 0xc00011e9e0, 0xb62700, 0xc00000e820, 0x0, 0x0, 0x0)
	/home/alex/go/pkg/mod/github.com/packethost/pkg@v0.0.0-20190715213007-7c3a64b4b5e3/log/log.go:119 +0xe4
main.main()
	/home/alex/go/src/github.com/tinkerbell/boots/main.go:58 +0x954
[alex@nuc boots]$ FACILITY_CODE=test ROLLBAR_DISABLE=1 API_AUTH_TOKEN=token API_CONSUMER_TOKEN=test1234 PACKET_VERSION=0 PACKET_VERSION=0 PACKET_ENV=test ROLLBAR_TOKEN=1 ./boots 
panic: looking up ip of mirror url: lookup install.test.packet.net on 8.8.8.8:53: no such host

goroutine 1 [running]:
github.com/tinkerbell/boots/env.mustFindMirrorIPBase(0xc000150880, 0xc000028380)
	/home/alex/go/src/github.com/tinkerbell/boots/env/mirror.go:85 +0x20a
github.com/tinkerbell/boots/env.init()
	/home/alex/go/src/github.com/tinkerbell/boots/env/mirror.go:23 +0x2b8

@vielmetti
Copy link
Author

@alexellis The puzzling thing to me is the information about what should be used as the "facility code" - that appears in the current code to resolve to a hard-coded lookup to a install.$(FACILITY_CODE).packet.net address, but for on-prem or homelab install there would need to be a change to that mirror url.

@alexellis
Copy link

Perhaps we are now going outside of the happy path?

@nathangoulding nathangoulding added this to Requests in Issues List Apr 14, 2020
@nathangoulding nathangoulding added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 21, 2020
@nathangoulding
Copy link
Contributor

We should remove this restriction.

@nathangoulding nathangoulding added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Jul 21, 2020
@nathangoulding nathangoulding moved this from Requests to Triaged in Issues List Jul 21, 2020
@nathangoulding nathangoulding added the size/S estimate of the amount of work to address the issue label Jul 21, 2020
@tstromberg tstromberg changed the title panic: required envvar is unset panic: required envvar is unset (ROLLBAR_TOKEN) Aug 27, 2021
@tstromberg tstromberg added kind/bug Categorizes issue or PR as related to a bug. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Aug 27, 2021
@displague
Copy link
Member

displague commented Jan 11, 2022

Closing this as the original issue is no longer present (ROLLBAR_TOKEN is not required).
https://github.com/tinkerbell/boots/blob/65d8c38/cmd/boots/main.go#L67-L78

Please open additional issues and refer back to this issue if other problems expressed in this thread need to be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. size/S estimate of the amount of work to address the issue
Projects
No open projects
Issues List
  
Triaged
Development

No branches or pull requests

7 participants