Skip to content

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

Description

@jiridanek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions