Make filebeat error: cannot find package "github.com/elastic/beats/filebeat/beater" in any of:

I install the beats directory under beats-5.5.1.
when i go to beats-5.5.1/filebeat, and run "make", got the following error:
go build
main.go:6:2: cannot find package "github.com/elastic/beats/filebeat/beater" in any of:
/home/yyu/svn/in-beats_trunk/.go-tools/go/src/github.com/elastic/beats/filebeat/beater (from $GOROOT)
/home/yyu/svn/in-beats_trunk/.go-tools/src/github.com/elastic/beats/filebeat/beater (from $GOPATH)
main.go:7:2: cannot find package "github.com/elastic/beats/libbeat/beat" in any of:
/home/yyu/svn/in-beats_trunk/.go-tools/go/src/github.com/elastic/beats/libbeat/beat (from $GOROOT)
/home/yyu/svn/in-beats_trunk/.go-tools/src/github.com/elastic/beats/libbeat/beat (from $GOPATH)
make: *** [filebeat] Error 1

It seems like filebeat is expected to be installed under $GOROOT/src/github.com/elastic/beats?
otherwise the build wont work?

Could you please confirm this? and curious why this is enforced this way, why the directory is not relative to $BEATS-HOME, as opposed to assuming BEATS_HOME = $GOROOT/src/github.com/elastic/beats?

thanks!
yan

It is expected that beats is checked out into its canonical location on the GOPATH (not GOROOT). This is standard for any Go project. See https://golang.org/doc/code.html#GOPATH

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.