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

explicitly report missing dependencies in the environment, e.g. nc #481

Closed
jiridanek opened this issue Mar 15, 2020 · 0 comments · Fixed by #484
Closed

explicitly report missing dependencies in the environment, e.g. nc #481

jiridanek opened this issue Mar 15, 2020 · 0 comments · Fixed by #484

Comments

@jiridanek
Copy link
Contributor

I observed failure

INFO[0000] repo.Repository.Run, [rev-parse --show-toplevel]  sourceLine="repo/repo.go:63"
INFO[0000] repo.Repository.Run complete. Err: <nil>      sourceLine="repo/repo.go:72"
INFO[0000] git.NewRepository: /tmp/scoot-tmp-024806936/gitdb-repo-963465879, top: /tmp/scoot-tmp-024806936/gitdb-repo-963465879  sourceLine="repo/repo.go:132"
INFO[0010] Killing 1 cmds                                sourceLine="setup/cmds.go:75"
INFO[0010] SIGINT: 32304 /root/go/bin/apiserver          sourceLine="setup/cmds.go:91"
INFO[0010] Cmd 32304 (/root/go/bin/apiserver) finished   sourceLine="setup/cmds.go:149"
INFO[0010] All completed                                 sourceLine="setup/cmds.go:100"
FATA[0010] port 11100 is not up after 5s                 sourceLine="setup-cloud-scoot/main.go:53"
exit status 1

Looking at the code, it became apparent I am missing nc. I installed that and it fixed the problem.

// Use exec.Command because we don't worry about these getting orphaned,
// and don't want to fill up our Cmds's list of running cmds
cmd := exec.Command("nc", "-z", "localhost", strconv.Itoa(port))
if err := cmd.Run(); err == nil {
log.Infof("Port %v active", port)
return nil
}

# yum install -y nc

In the future, there should be better error message. Possibly a check for all binaries up front? Possibly avoid using external nc, since go has reasonable facilities for network programing in the std lib.

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

Successfully merging a pull request may close this issue.

1 participant