# Issue while compiling beats

**URL:** <https://discuss.elastic.co/t/issue-while-compiling-beats/74886>\
**Category:** Beats\
**Created:** [February 13, 2017, 1:45pm UTC](https://discuss.elastic.co/t/issue-while-compiling-beats/74886 "2017-02-13T13:45:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerome\_tan](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@jerome\_tan](https://discuss.elastic.co/u/jerome_tan)\
**Post date:** [February 13, 2017, 1:45pm UTC](https://discuss.elastic.co/t/issue-while-compiling-beats/74886/1 "2017-02-13T13:45:46Z")

</div>

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](http://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](http://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](http://github.com/elastic/beats/libbeat/monitoring) 0.005s coverage: 69.1% of statements  
ok [github.com/elastic/beats/libbeat/monitoring/adapter](http://github.com/elastic/beats/libbeat/monitoring/adapter) 0.004s coverage: 61.3% of statements  
ok [github.com/elastic/beats/libbeat/outputs](http://github.com/elastic/beats/libbeat/outputs) 0.008s coverage: 44.5% of statements  
? [github.com/elastic/beats/libbeat/outputs/codecs](http://github.com/elastic/beats/libbeat/outputs/codecs) [no test files]  
ok [github.com/elastic/beats/libbeat/outputs/codecs/format](http://github.com/elastic/beats/libbeat/outputs/codecs/format) 0.004s coverage: 41.7% of statements  
ok [github.com/elastic/beats/libbeat/outputs/codecs/json](http://github.com/elastic/beats/libbeat/outputs/codecs/json) 0.004s coverage: 60.0% of statements  
ok [github.com/elastic/beats/libbeat/outputs/console](http://github.com/elastic/beats/libbeat/outputs/console) 0.004s coverage: 40.5% of statements  
ok [github.com/elastic/beats/libbeat/outputs/elasticsearch](http://github.com/elastic/beats/libbeat/outputs/elasticsearch) 0.016s coverage: 49.5% of statements  
ok [github.com/elastic/beats/libbeat/outputs/fileout](http://github.com/elastic/beats/libbeat/outputs/fileout) 0.035s coverage: 2.0% of statements  
ok [github.com/elastic/beats/libbeat/outputs/kafka](http://github.com/elastic/beats/libbeat/outputs/kafka) 0.019s coverage: 27.6% of statements  
ok [github.com/elastic/beats/libbeat/outputs/logstash](http://github.com/elastic/beats/libbeat/outputs/logstash) 1.733s coverage: 69.7% of statements  
? [github.com/elastic/beats/libbeat/outputs/mode](http://github.com/elastic/beats/libbeat/outputs/mode) [no test files]  
ok [github.com/elastic/beats/libbeat/outputs/mode/lb](http://github.com/elastic/beats/libbeat/outputs/mode/lb) 1.228s coverage: 84.1% of statements  
? [github.com/elastic/beats/libbeat/outputs/mode/modetest](http://github.com/elastic/beats/libbeat/outputs/mode/modetest) [no test files]  
ok [github.com/elastic/beats/libbeat/outputs/mode/modeutil](http://github.com/elastic/beats/libbeat/outputs/mode/modeutil) 0.005s coverage: 24.3% of statements  
ok [github.com/elastic/beats/libbeat/outputs/mode/single](http://github.com/elastic/beats/libbeat/outputs/mode/single) 1.069s coverage: 93.1% of statements  
ok [github.com/elastic/beats/libbeat/outputs/outil](http://github.com/elastic/beats/libbeat/outputs/outil) 0.008s coverage: 84.7% of statements  
ok [github.com/elastic/beats/libbeat/outputs/redis](http://github.com/elastic/beats/libbeat/outputs/redis) 0.004s coverage: 4.1% of statements  
? [github.com/elastic/beats/libbeat/outputs/transport](http://github.com/elastic/beats/libbeat/outputs/transport) [no test files]  
ok [github.com/elastic/beats/libbeat/outputs/transport/transptest](http://github.com/elastic/beats/libbeat/outputs/transport/transptest) 53.826s coverage: 58.6% of statements  
ok [github.com/elastic/beats/libbeat/paths](http://github.com/elastic/beats/libbeat/paths) 0.004s coverage: 63.0% of statements  
? [github.com/elastic/beats/libbeat/plugin](http://github.com/elastic/beats/libbeat/plugin) [no test files]  
command [go test -cover -coverprofile /tmp/gotestcover-675110426 [github.com/elastic/beats/libbeat/processors](http://github.com/elastic/beats/libbeat/processors)]: exit status 1

# [github.com/elastic/beats/libbeat/processors](http://github.com/elastic/beats/libbeat/processors)

package [github.com/elastic/beats/libbeat/processors\_test](http://github.com/elastic/beats/libbeat/processors_test)  
imports [github.com/elastic/beats/libbeat/processors/add\_cloud\_metadata](http://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](http://github.com/elastic/beats/libbeat/processors) [setup failed]  
ok [github.com/elastic/beats/libbeat/processors/actions](http://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](http://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](http://github.com/elastic/beats/libbeat/publisher) 0.028s coverage: 49.2% of statements  
ok [github.com/elastic/beats/libbeat/publisher/testing](http://github.com/elastic/beats/libbeat/publisher/testing) 0.005s coverage: 61.5% of statements  
? [github.com/elastic/beats/libbeat/service](http://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"??

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 13, 2017, 1:52pm UTC](https://discuss.elastic.co/t/issue-while-compiling-beats/74886/2 "2017-02-13T13:52:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jerome\_tan](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@jerome\_tan](https://discuss.elastic.co/u/jerome_tan)\
**Post date:** [February 14, 2017, 1:16pm UTC](https://discuss.elastic.co/t/issue-while-compiling-beats/74886/3 "2017-02-14T13:16:34Z")

</div>

Works thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 6, 2017, 1:46pm UTC](https://discuss.elastic.co/t/issue-while-compiling-beats/74886/4 "2017-03-06T13:46:22Z")

</div>

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