Issue while compiling beats


(jerome) #1

I want to extend packetbeat to support more protocols, while I compiled the beats, it reported an error:

.......
ok github.com/elastic/beats/libbeat/logp 0.124s coverage: 30.5% of statements
command [go test -cover -coverprofile /tmp/gotestcover-519179609 github.com/elastic/beats/libbeat/mock]: exit status 1
../../../src/github.com/elastic/beats/libbeat/processors/add_cloud_metadata/add_cloud_metadata.go:5:2: cannot find package "context" in any of:
/home/jerome/gocode/src/github.com/elastic/beats/vendor/context (vendor tree)
/usr/lib/golang/src/context (from $GOROOT)
/home/jerome/gocode/src/context (from $GOPATH)
ok github.com/elastic/beats/libbeat/monitoring 0.005s coverage: 69.1% of statements
ok github.com/elastic/beats/libbeat/monitoring/adapter 0.004s coverage: 61.3% of statements
ok github.com/elastic/beats/libbeat/outputs 0.008s coverage: 44.5% of statements
? github.com/elastic/beats/libbeat/outputs/codecs [no test files]
ok github.com/elastic/beats/libbeat/outputs/codecs/format 0.004s coverage: 41.7% of statements
ok github.com/elastic/beats/libbeat/outputs/codecs/json 0.004s coverage: 60.0% of statements
ok github.com/elastic/beats/libbeat/outputs/console 0.004s coverage: 40.5% of statements
ok github.com/elastic/beats/libbeat/outputs/elasticsearch 0.016s coverage: 49.5% of statements
ok github.com/elastic/beats/libbeat/outputs/fileout 0.035s coverage: 2.0% of statements
ok github.com/elastic/beats/libbeat/outputs/kafka 0.019s coverage: 27.6% of statements
ok github.com/elastic/beats/libbeat/outputs/logstash 1.733s coverage: 69.7% of statements
? github.com/elastic/beats/libbeat/outputs/mode [no test files]
ok github.com/elastic/beats/libbeat/outputs/mode/lb 1.228s coverage: 84.1% of statements
? github.com/elastic/beats/libbeat/outputs/mode/modetest [no test files]
ok github.com/elastic/beats/libbeat/outputs/mode/modeutil 0.005s coverage: 24.3% of statements
ok github.com/elastic/beats/libbeat/outputs/mode/single 1.069s coverage: 93.1% of statements
ok github.com/elastic/beats/libbeat/outputs/outil 0.008s coverage: 84.7% of statements
ok github.com/elastic/beats/libbeat/outputs/redis 0.004s coverage: 4.1% of statements
? github.com/elastic/beats/libbeat/outputs/transport [no test files]
ok github.com/elastic/beats/libbeat/outputs/transport/transptest 53.826s coverage: 58.6% of statements
ok github.com/elastic/beats/libbeat/paths 0.004s coverage: 63.0% of statements
? github.com/elastic/beats/libbeat/plugin [no test files]
command [go test -cover -coverprofile /tmp/gotestcover-675110426 github.com/elastic/beats/libbeat/processors]: exit status 1

github.com/elastic/beats/libbeat/processors

package github.com/elastic/beats/libbeat/processors_test
imports github.com/elastic/beats/libbeat/processors/add_cloud_metadata
imports context: cannot find package "context" in any of:
/home/jerome/gocode/src/github.com/elastic/beats/vendor/context (vendor tree)
/usr/lib/golang/src/context (from $GOROOT)
/home/jerome/gocode/src/context (from $GOPATH)
FAIL github.com/elastic/beats/libbeat/processors [setup failed]
ok github.com/elastic/beats/libbeat/processors/actions 0.043s coverage: 44.5% of statements
command [go test -cover -coverprofile /tmp/gotestcover-212914780 github.com/elastic/beats/libbeat/processors/add_cloud_metadata]: exit status 1
../../../src/github.com/elastic/beats/libbeat/processors/add_cloud_metadata/add_cloud_metadata.go:5:2: cannot find package "context" in any of:
/home/jerome/gocode/src/github.com/elastic/beats/vendor/context (vendor tree)
/usr/lib/golang/src/context (from $GOROOT)
/home/jerome/gocode/src/context (from $GOPATH)
ok github.com/elastic/beats/libbeat/publisher 0.028s coverage: 49.2% of statements
ok github.com/elastic/beats/libbeat/publisher/testing 0.005s coverage: 61.5% of statements
? github.com/elastic/beats/libbeat/service [no test files]
test failed
make[2]: *** [unit-tests] Error 1
make[2]: Leaving directory /home/jerome/gocode/packetbeat/beats/libbeat' make[1]: *** [testsuite] Error 2 make[1]: Leaving directory/home/jerome/gocode/packetbeat/beats/libbeat'
make: *** [testsuite] Error 1

Is it because of the missing package "context"??


(Magnus B├Ąck) #2

Beats requires Go 1.7, see https://github.com/elastic/beats/blob/master/CONTRIBUTING.md.


(jerome) #3

Works thanks


(system) #4

This topic was automatically closed after 21 days. New replies are no longer allowed.