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

Unfriendly error when gin could not find go tool #124

Open
pavel-odintsov opened this issue Oct 15, 2017 · 1 comment
Open

Unfriendly error when gin could not find go tool #124

pavel-odintsov opened this issue Oct 15, 2017 · 1 comment

Comments

@pavel-odintsov
Copy link

Hello!

I spent some time to understand what's going on when tried to run gin from root user.

I got following error:

[gin] Listening on port 10007
[gin] Building...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x6877f0]

goroutine 1 [running]:
github.com/codegangsta/gin/lib.(*builder).Build(0xc42007c480, 0xc4200552b0, 0x1)
	/home/odintsov/go/src/github.com/codegangsta/gin/lib/builder.go:62 +0x340
main.build(0x92aa20, 0xc42007c480, 0x92b760, 0xc42007c4e0, 0xc42007a3c0)
	/home/odintsov/go/src/github.com/codegangsta/gin/main.go:221 +0xcb
main.MainAction(0xc42009e840)
	/home/odintsov/go/src/github.com/codegangsta/gin/main.go:193 +0xa51
gopkg.in/urfave/cli%2ev1.HandleAction(0x72e3e0, 0x7bec10, 0xc42009e840, 0xc42007c400, 0x0)
	/home/odintsov/go/src/gopkg.in/urfave/cli.v1/app.go:492 +0x7c
gopkg.in/urfave/cli%2ev1.Command.Run(0x7aabe3, 0x3, 0x7aa91e, 0x1, 0x0, 0x0, 0x0, 0x7baa58, 0x32, 0x0, ...)
	/home/odintsov/go/src/gopkg.in/urfave/cli.v1/command.go:210 +0xb6e
gopkg.in/urfave/cli%2ev1.(*App).Run(0xc42006d380, 0xc42008e000, 0x9, 0x9, 0x0, 0x0)
	/home/odintsov/go/src/gopkg.in/urfave/cli.v1/app.go:255 +0x76f
main.main()
	/home/odintsov/go/src/github.com/codegangsta/gin/main.go:131 +0xd0d

Line 62 from gin's code:

if command.ProcessState.Success() {

I spent about 1 hour to find that I do not have "go" in PATH for the root user and then fixed the issue!

Could you add this check?

@kwiesmueller
Copy link

Getting the same error but can't find a solution

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

No branches or pull requests

2 participants