Unable to compile custom beat based on metricbeat

(Davy Croonen) #1

Hi all

After upgrading the Beat library from 6.0 to 6.2 I'm unable to package my custom Beat based on Metricbeat. The error message is:

Step 4/9 : RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y flex bison
---> Running in fb281bd71978
Hit http://archive.debian.org squeeze Release.gpg
Hit http://archive.debian.org squeeze-lts Release.gpg
Hit http://archive.debian.org squeeze Release
Ign http://archive.debian.org squeeze Release
Hit http://archive.debian.org squeeze-lts Release
Hit http://archive.debian.org squeeze/main amd64 Packages
Hit http://archive.debian.org squeeze/contrib amd64 Packages
Hit http://archive.debian.org squeeze-lts/main amd64 Packages
Reading package lists...
W: GPG error: http://archive.debian.org squeeze Release: The following signatures were invalid: KEYEXPIRED 1520281423 KEYEXPIRED 1501892461
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
The following NEW packages will be installed:
bison flex
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 911 kB of archives.
After this operation, 2925 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
flex bison
E: There are problems and -y was used without --force-yes
The command '/bin/sh -c apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y flex bison' returned a non-zero code: 100
Makefile:48: recipe for target 'xgo-image' failed
make[1]: *** [xgo-image] Error 100
make[1]: Leaving directory '/opt/bamboo-agent-home/xml-data/build-dir/SMB-REL-JOB1/src/github.com/dcroonen/smartbeat/vendor/github.com/elastic/beats/dev-tools/packer'
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:423: recipe for target 'package-setup' failed
make: *** [package-setup] Error 2

I understood from this, it has something to do with C support for GO. As I don't use any C libraries in my GO code I don't need either the C support. Their is a variable, called CGO set to true in vendor/github.com/elastic/beats/libbeat/scripts/Makefile, of which I think that it should handle this but setting this variable to false doesn't do anything.

Anybody any thougths? Anybody knowing how to turn this off?

Kind regards

(Davy Croonen) #2

Ok I mananged to get this through by commenting out line 50 and 51 in vendor/github.com/elastic/beats/dev-tools/packer/Makefile and by running the make package command with the options SNAPSHOT=no CGO=false PACKAGES=${BEAT_NAME}/deb TARGETS="linux/amd64 linux/386".

Note: This only builds .deb packages but at the moment this is enough for my purposes.

Anybody any thoughts on this because commenting out lines in Makefiles doesn't feel as the right way to go?


Custom beat based on metric doesn't run in the background when started via inet.d
(ruflin) #3

I wonder if the above issue is related to some recent issues we had with debian 6.

About the variables: Instead of changing the Makefile you can overload them when calling the command like CGO=false make package.

(system) #4

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