Beats compile issue


(jerome) #1

When I compiled the code of beats, it reported an error like this:
ok github.com/elastic/beats/libbeat/outputs/mode/lb 1.190s 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.028s coverage: 24.3% of statements
ok github.com/elastic/beats/libbeat/outputs/mode/single 1.017s 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.012s coverage: 4.1% of statements
? 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]: 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


(Tudor Golubenco) #2

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.


(jerome) #3

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
../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


(system) #4

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