Makefile:294: recipe for target 'update' failed

Hi, new to beats here.

I am trying to build the beats project straight out of github and I need some help.

user@ubuntu17:~/code/beats$ make

The problem seems to be related to _meta/beat.yml not being in the place expected:

make[1]: Entering directory '/home/user/code/beats/libbeat'
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/user/code/beats/libbeat/build/python-env/bin/python2
Also creating executable in /home/user/code/beats/libbeat/build/python-env/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
Updating generated files for libbeat
cat: _meta/beat.yml: No such file or directory
cat: _meta/beat.yml: No such file or directory
make[2]: Entering directory '/home/user/code/beats/libbeat'
make[2]: Leaving directory '/home/user/code/beats/libbeat'
bash: go: command not found
scripts/Makefile:294: recipe for target 'update' failed
make[1]: *** [update] Error 127
make[1]: Leaving directory '/home/user/code/beats/libbeat'
Makefile:21: recipe for target 'testsuite' failed
make: *** [testsuite] Error 1

I installed the dependencies I could figured out:

sudo apt install golang-1.9 virtualenv

golang-1.9: 1.9.1-2ubuntu1
virtualenv: 15.1.0+ds-1

So, can anyone help?

Hi @thro,

Probably you need to install golang-1.9-go too

Hi @exekias,

It seems to be installed and at the newest version:

golang-1.9-go is already the newest version (1.9.1-2ubuntu1)

What happens if you try to run go? It should be available under $PATH for make to work

Thank you, I'm also new to go so figuring this out as I go.

It looks like it's not in path, I will take a look in a bit:

user@ubuntu17:~/code/beats$ go

The program 'go' can be found in the following packages:
 * golang-go
 * gccgo-go
Try: sudo apt install <selected package>

*facepalm* ... 'go' was not in path. Like clearly stated in the error output.

Fixed it with:

sudo update-alternatives --install /usr/bin/go go /usr/lib/go-1.9/bin/go 50 --slave /usr/bin/gofmt gofmt /usr/lib/go-1.9/bin/gofmt

Then I got new problem

user@ubuntu17:~/code/beats$ make

make[1]: Entering directory '/home/user/code/beats/libbeat'
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/user/code/beats/libbeat/build/python-env/bin/python2
Also creating executable in /home/user/code/beats/libbeat/build/python-env/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
Updating generated files for libbeat
cat: _meta/beat.yml: No such file or directory
cat: _meta/beat.yml: No such file or directory
make[2]: Entering directory '/home/user/code/beats/libbeat'
make[2]: Leaving directory '/home/user/code/beats/libbeat'
../dev-tools/cmd/kibana_index_pattern/kibana_index_pattern.go:8:2: cannot find package "github.com/elastic/beats/libbeat/common" in any of:
    /usr/lib/go-1.9/src/github.com/elastic/beats/libbeat/common (from $GOROOT)
    /home/user/go/src/github.com/elastic/beats/libbeat/common (from $GOPATH)
../dev-tools/cmd/kibana_index_pattern/kibana_index_pattern.go:9:2: cannot find package "github.com/elastic/beats/libbeat/kibana" in any of:
    /usr/lib/go-1.9/src/github.com/elastic/beats/libbeat/kibana (from $GOROOT)
    /home/user/go/src/github.com/elastic/beats/libbeat/kibana (from $GOPATH)
../dev-tools/cmd/kibana_index_pattern/kibana_index_pattern.go:10:2: cannot find package "github.com/elastic/beats/libbeat/version" in any of:
    /usr/lib/go-1.9/src/github.com/elastic/beats/libbeat/version (from $GOROOT)
    /home/user/go/src/github.com/elastic/beats/libbeat/version (from $GOPATH)
scripts/Makefile:294: recipe for target 'update' failed
make[1]: *** [update] Error 1
make[1]: Leaving directory '/home/user/code/beats/libbeat'
Makefile:21: recipe for target 'testsuite' failed
make: *** [testsuite] Error 1

Which I fixed with:

go get github.com/elastic/beats/libbeat

But now I had a brand new problem, how do I get '/bin/gotestcover' for the unit tests:

user@ubuntu17:~/code/beats$ make

make[1]: Entering directory '/home/user/code/beats/libbeat'
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/user/code/beats/libbeat/build/python-env/bin/python2
Also creating executable in /home/user/code/beats/libbeat/build/python-env/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
Updating generated files for libbeat
cat: _meta/beat.yml: No such file or directory
cat: _meta/beat.yml: No such file or directory
make[2]: Entering directory '/home/user/code/beats/libbeat'
make[2]: Leaving directory '/home/user/code/beats/libbeat'
-- The index pattern was created under /home/user/code/beats/libbeat/_meta/kibana/5/index-pattern/libbeat.json
-- The index pattern was created under /home/user/code/beats/libbeat/_meta/kibana/6/index-pattern/libbeat.json
make unit-tests
make[2]: Entering directory '/home/user/code/beats/libbeat'
mkdir -p /home/user/code/beats/libbeat/build/coverage
# gotestcover is needed to fetch coverage for multiple packages
go get github.com/elastic/beats/vendor/github.com/pierrre/gotestcover
# testify is needed for unit and integration tests
go get github.com/elastic/beats/vendor/github.com/stretchr/testify/assert
# libcompose is needed for integration tests
go get github.com/docker/libcompose
go test -i github.co.....bbeat/version
/bin/gotestcover  -coverprofile=/hom......bbeat/version
bash: /bin/gotestcover: No such file or directory
scripts/Makefile:164: recipe for target 'unit-tests' failed
make[2]: *** [unit-tests] Error 127
make[2]: Leaving directory '/home/user/code/beats/libbeat'
scripts/Makefile:249: recipe for target 'testsuite' failed
make[1]: *** [testsuite] Error 2
make[1]: Leaving directory '/home/user/code/beats/libbeat'
Makefile:21: recipe for target 'testsuite' failed
make: *** [testsuite] Error 1

Which I fixed with:

go get github.com/powerman/gotestcover
sudo ln -s /home/user/go/bin/gotestcover /bin/gotestcover

Thanks @exekias, you got me started.

There is still some problems still building out of the box, but what I wanted to do for now is crosscompile for arm.

That seems to be working so I am not going any deeper down the rabbit hole.

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