# Beats compile issue

**URL:** <https://discuss.elastic.co/t/beats-compile-issue/75037>\
**Category:** Beats\
**Created:** [February 14, 2017, 1:18pm UTC](https://discuss.elastic.co/t/beats-compile-issue/75037 "2017-02-14T13:18:31Z")\
**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 14, 2017, 1:18pm UTC](https://discuss.elastic.co/t/beats-compile-issue/75037/1 "2017-02-14T13:18:31Z")

</div>

When I compiled the code of beats, it reported an error like this:  
ok [github.com/elastic/beats/libbeat/outputs/mode/lb](http://github.com/elastic/beats/libbeat/outputs/mode/lb) 1.190s 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.028s coverage: 24.3% of statements  
ok [github.com/elastic/beats/libbeat/outputs/mode/single](http://github.com/elastic/beats/libbeat/outputs/mode/single) 1.017s 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.012s coverage: 4.1% of statements  
? [github.com/elastic/beats/libbeat/outputs/transport](http://github.com/elastic/beats/libbeat/outputs/transport) [no test files]  
command [go test -cover -coverprofile /tmp/gotestcover-969087937 [github.com/elastic/beats/libbeat/outputs/transport/transptest](http://github.com/elastic/beats/libbeat/outputs/transport/transptest)]: exit status 1  
2017/02/14 05:02:33 [ERR] socks: Failed to handle request: Connect to invalid.dns.fqdn-unknown.invalid (180.168.41.175):100 failed: dial tcp 180.168.41.175:100: getsockopt: connection refused  
2017/02/14 05:02:54 [ERR] socks: Failed to handle request: Connect to invalid.dns.fqdn-unknown.invalid (180.168.41.175):100 failed: dial tcp 180.168.41.175:100: getsockopt: connection refused  
--- FAIL: TestTransportFailConnectUnknownAddress (52.26s)  
Error Trace: testing\_test.go:108  
testing\_test.go:112  
Error: Expected value not to be nil.

2017/02/14 05:02:54 [ERR] socks: Failed to handle request: read tcp 127.0.0.1:57704-\>127.0.0.1:54061: read tcp 127.0.0.1:48856-\>127.0.0.1:53020: read: connection reset by peer  
2017/02/14 05:02:54 [ERR] socks: Failed to handle request: read tcp 127.0.0.1:57704-\>127.0.0.1:54063: read tcp 127.0.0.1:48858-\>127.0.0.1:53020: read: connection reset by peer  
FAIL  
coverage: 58.6% of statements

seems to be a net work connection problem, how can I work around? Thanks

---

<div class="post-metadata">

**Author:** ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)\
**Post date:** [February 14, 2017, 1:21pm UTC](https://discuss.elastic.co/t/beats-compile-issue/75037/2 "2017-02-14T13:21:38Z")

</div>

The default `make` command is also executing the tests. If you just want to compile one Beat, you can execute `make` or `go build` in the Beat directory.

If you're interested in running the tests, please review the CONTRIBUTING guide for a set of dependencies that you have to install.

---

<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:39pm UTC](https://discuss.elastic.co/t/beats-compile-issue/75037/3 "2017-02-14T13:39:27Z")

</div>

When I went into the folder packerbeat and run the command make, reported no such file error:  
[root@drill3 beats]# cd packetbeat/  
[root@drill3 packetbeat]# make  
go build  
[github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap](http://github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap)  
../vendor/github.com/tsg/gopacket/pcap/pcap.go:20:18: fatal error: pcap.h: No such file or directory  
#include \<pcap.h\>  
^  
compilation terminated.  
make: \*\*\* [packetbeat] Error 2

======================================================  
Solved by install libpcap-devel

---

<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 7, 2017, 1:18pm UTC](https://discuss.elastic.co/t/beats-compile-issue/75037/4 "2017-03-07T13:18:39Z")

</div>

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