I have tried the fix today and got another similar error at make package stage:
echo Creating DEB packages for test27122016
Creating DEB packages for test27122016
ARCH=386 BEAT=test27122016 BUILD_DIR=/home/user/go_workspace/src/github.com/user/test27122016/build BEAT_DIR=/home/user/go_workspace/src/github.com/user/test27122016 BUILDID= SNAPSHOT=yes /home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh
/home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh: 12: /home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh: gotpl: not found
Makefile:13: recipe for target 'test27122016/deb' failed
make[1]: *** [test27122016/deb] Error 127
make[1]: Leaving directory '/home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer'
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:400: recipe for target 'package' failed
make: *** [package] Error 2
Extended make package output is below:
...
Fetching dependencies...
Execute /scripts/before_build.sh github.com/user/test27122016
install -d -m 755 /build/homedir/scripts/
install -m 755 ./vendor/github.com/elastic/beats/libbeat/scripts/migrate_beat_config_1_x_to_5_0.py /build/homedir/scripts/
Compiling import_dashboards for linux/amd64
Compiling import_dashboards for linux/386
Compiling import_dashboards for windows/amd64
Compiling import_dashboards for windows/386
Compiling import_dashboards for darwin/amd64
Cloning into '/go/src/github.com/tsg/gotpl'...
make: Nothing to be done for `before-build'.
Compiling test27122016 for linux/amd64...
Compiling test27122016 for linux/386...
Compiling test27122016 for windows-4.0/amd64...
Compiling test27122016 for windows-4.0/386...
Compiling test27122016 for darwin/amd64...
Build process completed
make[1]: Leaving directory '/home/user/go_workspace/src/github.com/user/test27122016'
SNAPSHOT=yes BUILDID= BEAT_DIR=github.com/user/test27122016 BUILD_DIR=/home/user/go_workspace/src/github.com/user/test27122016/build make -C ./vendor/github.com/elastic/beats/dev-tools/packer test27122016/deb test27122016/rpm test27122016/darwin test27122016/win test27122016/bin /home/user/go_workspace/src/github.com/user/test27122016/build/upload/build_id.txt
make[1]: Entering directory '/home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer'
docker run --rm -v /home/user/go_workspace/src/github.com/user/test27122016/build:/build tudorg/go-daemon
Fetching go-daemon
Cloning into 'go-daemon'...
Compiling for linux/amd64..
/tmp/ccHpxljV.o: In function `main':
god.c:(.text+0x2ca): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
god.c:(.text+0x262): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Compiling for linux/i386..
/tmp/ccIl6uos.o: In function `main':
god.c:(.text+0x2ee): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
god.c:(.text+0x287): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Copying to host..
docker build --rm=true -t tudorg/fpm /home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer/docker/fpm-image
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM ubuntu:16.04
---> e4415b714b62
Step 2 : MAINTAINER Tudor Golubenco <tudor@elastic.co>
---> Using cache
---> 5563b321f868
Step 3 : RUN apt-get update && apt-get install -y --no-install-recommends build-essential ruby-dev rpm zip dos2unix libgmp3-dev
---> Using cache
---> 0f14779ca09c
Step 4 : RUN gem install fpm
---> Using cache
---> 5def1a2c73a9
Successfully built 5def1a2c73a9
echo Creating DEB packages for test27122016
Creating DEB packages for test27122016
ARCH=386 BEAT=test27122016 BUILD_DIR=/home/user/go_workspace/src/github.com/user/test27122016/build BEAT_DIR=/home/user/go_workspace/src/github.com/user/test27122016 BUILDID= SNAPSHOT=yes /home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh
/home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh: 12: /home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh: gotpl: not found
Makefile:13: recipe for target 'test27122016/deb' failed
make[1]: *** [test27122016/deb] Error 127
make[1]: Leaving directory '/home/user/go_workspace/src/github.com/user/test27122016/vendor/github.com/elastic/beats/dev-tools/packer'
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:400: recipe for target 'package' failed
make: *** [package] Error 2
We very recently change some code related to gotpl and these templates. Any chance you could again update to the most recent version of libbeat (master) and check again. Make sure to run make clean in advance.
echo "Start building packages for test03012017"
Start building packages for test03012017
mkdir -p /home/user/go_workspace/src/github.com/user/test03012017/build/upload
Generates the package.yml file with all information needed to create packages
...
make[1]: Entering directory '/home/user/go_workspace/src/github.com/user/test03012017'
fatal: Not a git repository (or any of the parent directories): .git
cross compile on ubuntu
docker run --rm
-v /home/user/go_workspace/src/github.com/user/test03012017/vendor/github.com/elastic/beats/dev-tools/packer/xgo-scripts:/scripts
-v /home/user/go_workspace/src/github.com/user/test03012017/vendor/github.com/elastic/beats/dev-tools/packer:/templates
-v /home/user/go_workspace/src/github.com/user:/source
-v /home/user/go_workspace/src/github.com/user/test03012017/build:/build
-e PUREGO="yes"
-e PACK=test03012017
-e BEFORE_BUILD=before_build.sh
-e SOURCE=/source
-e TARGETS="linux/amd64 linux/386 windows/amd64 windows/386 darwin/amd64"
-e BUILDID=
tudorg/beats-builder github.com/user/test03012017
Working directory=/go/src/github.com/user
Copying main source folder /source to folder /go/src/github.com/user
Fetching dependencies...
Execute /scripts/before_build.sh github.com/user/test03012017
install -d -m 755 /build/homedir/scripts/
install -m 755 ./vendor/github.com/elastic/beats/libbeat/scripts/migrate_beat_config_1_x_to_5_0.py /build/homedir/scripts/
Compiling import_dashboards for linux/amd64
Compiling import_dashboards for linux/386
Compiling import_dashboards for windows/amd64
Compiling import_dashboards for windows/386
Compiling import_dashboards for darwin/amd64
Cloning into '/go/src/github.com/tsg/gotpl'...
make: Nothing to be done for before-build'. Compiling test03012017 for linux/amd64... Compiling test03012017 for linux/386... Compiling test03012017 for windows-4.0/amd64... Compiling test03012017 for windows-4.0/386... Compiling test03012017 for darwin/amd64... Build process completed make[1]: Leaving directory '/home/user/go_workspace/src/github.com/user/test03012017' SNAPSHOT=yes BUILDID= BEAT_DIR=github.com/user/test03012017 BUILD_DIR=/home/user/go_workspace/src/github.com/user/test03012017/build make -C ./vendor/github.com/elastic/beats/dev-tools/packer test03012017/deb test03012017/rpm test03012017/darwin test03012017/win test03012017/bin /home/user/go_workspace/src/github.com/user/test03012017/build/upload/build_id.txt make[1]: Entering directory '/home/user/go_workspace/src/github.com/user/test03012017/vendor/github.com/elastic/beats/dev-tools/packer' docker run --rm -v /home/user/go_workspace/src/github.com/user/test03012017/build:/build tudorg/go-daemon Fetching go-daemon Cloning into 'go-daemon'... Compiling for linux/amd64.. /tmp/cc9Yke9f.o: In function main':
god.c:(.text+0x2ca): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
god.c:(.text+0x262): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Compiling for linux/i386..
/tmp/cc08rmPq.o: In function `main':
god.c:(.text+0x2ee): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
god.c:(.text+0x287): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Copying to host..
docker build --rm=true -t tudorg/fpm /home/user/go_workspace/src/github.com/user/test03012017/vendor/github.com/elastic/beats/dev-tools/packer/docker/fpm-image
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM ubuntu:16.04
---> e4415b714b62
Step 2 : MAINTAINER Tudor Golubenco tudor@elastic.co
---> Using cache
---> 5563b321f868
Step 3 : RUN apt-get update && apt-get install -y --no-install-recommends build-essential ruby-dev rpm zip dos2unix libgmp3-dev
---> Using cache
---> 0f14779ca09c
Step 4 : RUN gem install fpm
---> Using cache
---> 5def1a2c73a9
Successfully built 5def1a2c73a9
echo Creating DEB packages for test03012017
Creating DEB packages for test03012017
ARCH=386 BEAT=test03012017 BUILD_DIR=/home/user/go_workspace/src/github.com/user/test03012017/build BEAT_DIR=/home/user/go_workspace/src/github.com/user/test03012017 BUILDID= SNAPSHOT=yes /home/user/go_workspace/src/github.com/user/test03012017/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh
/home/user/go_workspace/src/github.com/user/test03012017/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh: 12: /home/user/go_workspace/src/github.com/user/test03012017/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh: gotpl: not found
Makefile:13: recipe for target 'test03012017/deb' failed
make[1]: *** [test03012017/deb] Error 127
make[1]: Leaving directory '/home/user/go_workspace/src/github.com/user/test03012017/vendor/github.com/elastic/beats/dev-tools/packer'
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:400: recipe for target 'package' failed
make: *** [package] Error 2
After the steps:
export GOPATH=/home/user/go_workspace
export PATH=$PATH:/usr/local/go/bin
rm -rf /home/user/go_workspace/*
cd /home/user/go_workspace/
go get github.com/elastic/beats
mkdir $GOPATH/src/github.com/user
cd $GOPATH/src/github.com/user
cookiecutter $GOPATH/src/github.com/elastic/beats/generate/beat
cd /home/user/go_workspace/src/github.com/user/test03012017/
make clean
make setup
make package
I rechecked the issue today using the following version:
# cd $GOPATH/src/github.com/elastic/beats/libbeat/
# git rev-parse --short HEAD
19e82d5
The error is:
make[1]: Entering directory '/home/user/go_workspace/src/github.com/user/test120117'
fatal: Not a git repository (or any of the parent directories): .git
# cross compile on ubuntu
docker run --rm \
-v /home/user/go_workspace/src/github.com/user/test120117/vendor/github.com/elastic/beats/dev-tools/packer/xgo-scripts:/scripts \
-v /home/user/go_workspace/src/github.com/user/test120117/vendor/github.com/elastic/beats/dev-tools/packer:/templates \
-v /home/user/go_workspace/src/github.com/user:/source \
-v /home/user/go_workspace/src/github.com/user/test120117/build:/build \
-e PUREGO="yes" \
-e PACK=test120117 \
-e BEFORE_BUILD=before_build.sh \
-e SOURCE=/source \
-e TARGETS="linux/amd64 linux/386 windows/amd64 windows/386 darwin/amd64" \
-e BUILDID= \
tudorg/beats-builder \
github.com/user/test120117
Working directory=/go/src/github.com/user
Copying main source folder /source to folder /go/src/github.com/user
Fetching dependencies...
Execute /scripts/before_build.sh github.com/user/test120117
install -d -m 755 /build/homedir/scripts/
install -m 755 ./vendor/github.com/elastic/beats/libbeat/scripts/migrate_beat_config_1_x_to_5_0.py /build/homedir/scripts/
Compiling import_dashboards for linux/amd64
Compiling import_dashboards for linux/386
Compiling import_dashboards for windows/amd64
Compiling import_dashboards for windows/386
Compiling import_dashboards for darwin/amd64
Cloning into '/go/src/github.com/tsg/gotpl'...
make: Nothing to be done for `before-build'.
Compiling test120117 for linux/amd64...
Compiling test120117 for linux/386...
Compiling test120117 for windows-4.0/amd64...
Compiling test120117 for windows-4.0/386...
Compiling test120117 for darwin/amd64...
Build process completed
make[1]: Leaving directory '/home/user/go_workspace/src/github.com/user/test120117'
SNAPSHOT=yes BUILDID= BEAT_DIR=github.com/user/test120117 BUILD_DIR=/home/user/go_workspace/src/github.com/user/test120117/build make -C ./vendor/github.com/elastic/beats/dev-tools/packer test120117/deb test120117/rpm test120117/darwin test120117/win test120117/bin /home/user/go_workspace/src/github.com/user/test120117/build/upload/build_id.txt
make[1]: Entering directory '/home/user/go_workspace/src/github.com/user/test120117/vendor/github.com/elastic/beats/dev-tools/packer'
docker run --rm -v /home/user/go_workspace/src/github.com/user/test120117/build:/build tudorg/go-daemon
Fetching go-daemon
Cloning into 'go-daemon'...
Compiling for linux/amd64..
/tmp/ccj0a8Vu.o: In function `main':
god.c:(.text+0x2ca): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
god.c:(.text+0x262): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Compiling for linux/i386..
/tmp/cc9NmdkE.o: In function `main':
god.c:(.text+0x2ee): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
god.c:(.text+0x287): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Copying to host..
docker build --rm=true -t tudorg/fpm /home/user/go_workspace/src/github.com/user/test120117/vendor/github.com/elastic/beats/dev-tools/packer/docker/fpm-image
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM ubuntu:16.04
---> e4415b714b62
Step 2 : MAINTAINER Tudor Golubenco <tudor@elastic.co>
---> Using cache
---> 5563b321f868
Step 3 : RUN apt-get update && apt-get install -y --no-install-recommends build-essential ruby-dev rpm zip dos2unix libgmp3-dev
---> Using cache
---> 0f14779ca09c
Step 4 : RUN gem install fpm
---> Using cache
---> 5def1a2c73a9
Successfully built 5def1a2c73a9
echo Creating DEB packages for test120117
Creating DEB packages for test120117
ARCH=386 BEAT=test120117 BUILD_DIR=/home/user/go_workspace/src/github.com/user/test120117/build BEAT_DIR=/home/user/go_workspace/src/github.com/user/test120117 BUILDID= SNAPSHOT=yes /home/user/go_workspace/src/github.com/user/test120117/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh
/home/user/go_workspace/src/github.com/user/test120117/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh: 12: /home/user/go_workspace/src/github.com/user/test120117/vendor/github.com/elastic/beats/dev-tools/packer/platforms/debian/build.sh: gotpl: not found
Makefile:14: recipe for target 'test120117/deb' failed
make[1]: *** [test120117/deb] Error 127
make[1]: Leaving directory '/home/user/go_workspace/src/github.com/user/test120117/vendor/github.com/elastic/beats/dev-tools/packer'
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:397: recipe for target 'package' failed
make: *** [package] Error 2
For the Makefile: We just merged a PR and you need to change BEATNAME to BEAT_NAME and BEAT_DIR to BEAT_PATH. But this should not be related to this issue.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.