Error on make setup

Hi, I'm trying to create a new beat by using this guide - https://www.elastic.co/guide/en/beats/devguide/6.4/new-beat.html
After I generated my beat and trying to setup it with 'make setup' command I received this error:
zotan$ make setup
mkdir -p vendor/github.com/elastic
cp -R /Users/zotan/Projects/go/src/github.com/elastic/beats vendor/github.com/elastic/
rm -rf vendor/github.com/elastic/beats/.git vendor/github.com/elastic/beats/x-pack
mkdir -p vendor/github.com/magefile
cp -R /Users/zotan/Projects/go/src/github.com/elastic/beats/vendor/github.com/magefile/mage vendor/github.com/magefile
git init
Reinitialized existing Git repository in /Users/zotan/Projects/go/src/github.com/zotan/mysqlbeat/.git/
go install github.com/zotan/mysqlbeat/vendor/github.com/magefile/mage
make: [mage] Error 127 (ignored)
bash: mage: command not found
make: *** [fields] Error 127
I tried to do this on the different machine (with Ubuntu) and received the exact same error. Could anyone help me please with that?

It seems the guide needs to be updated or the mage dependency installed automatically.

As a workaround, you can install it yourself:

go get github.com/magefile/mage

Unfortunately this did not help:

azotin@azotin:~/go/src/github.com/azotin/mysqlbeat$ go get github.com/magefile/mage
azotin@azotin:~/go/src/github.com/azotin/mysqlbeat$ make setup
mkdir -p vendor/github.com/elastic
cp -R /home/azotin/go/src/github.com/elastic/beats vendor/github.com/elastic/
rm -rf vendor/github.com/elastic/beats/.git vendor/github.com/elastic/beats/x-pack
mkdir -p vendor/github.com/magefile
cp -R /home/azotin/go/src/github.com/elastic/beats/vendor/github.com/magefile/mage vendor/github.com/magefile
go install github.com/azotin/mysqlbeat/vendor/github.com/magefile/mage
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:441: recipe for target 'mage' failed
make: [mage] Error 127 (ignored)
bash: mage: command not found
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:308: recipe for target 'fields' failed
make: *** [fields] Error 127
azotin@azotin:~/go/src/github.com/azotin/mysqlbeat$

Try adding $GOPATH/bin to your $PATH:

export PATH="$GOPATH/bin:$PATH"

If GOPATH is not set, then use ~/go/bin

2 Likes

It helped, thank you)

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