Inteface conversion in running time error of a custum beat


(Boubker Elamri) #1

hi everyone,

I'm working on a beat and I came across an error like this :
2017/08/08 07:46:39.505926 beat.go:267: INFO Home path: [/home/hp/src/github.com/bob96/hc34] Config path: [/home/hp/src/github.com/bob96/hc34] Data path: [/home/hp/src/github.com/bob96/hc34/data] Logs path: [/home/hp/src/github.com/bob96/hc34/logs]
2017/08/08 07:46:39.505957 beat.go:177: INFO Setup Beat: hc34; Version: 5.1.3
2017/08/08 07:46:39.506040 logp.go:219: INFO Metrics logging every 30s
2017/08/08 07:46:39.506086 output.go:167: INFO Loading template enabled. Reading template file: /home/hp/src/github.com/bob96/hc34/hc34.template.json
2017/08/08 07:46:39.506262 output.go:178: INFO Loading template enabled for Elasticsearch 2.x. Reading template file: /home/hp/src/github.com/bob96/hc34/hc34.template-es2x.json
2017/08/08 07:46:39.506655 client.go:120: INFO Elasticsearch url: http://localhost:9200
2017/08/08 07:46:39.506691 outputs.go:106: INFO Activated elasticsearch as output plugin.
2017/08/08 07:46:39.506756 publish.go:291: INFO Publisher name: hp-HP-Pavilion-15-Notebook-PC
2017/08/08 07:46:39.507171 async.go:63: INFO Flush Interval set to: 1s
2017/08/08 07:46:39.507188 async.go:64: INFO Max Bulk Size set to: 50
2017/08/08 07:46:39.507793 beat.go:207: INFO hc34 start running.
2017/08/08 07:46:39.507926 hc34.go:98: INFO hc34 is running! Hit CTRL-C to stop it.
2017/08/08 07:46:39.529717 hc34.go:174: INFO Event sent
2017/08/08 07:46:39.529741 hc34.go:107: INFO Event sent
2017/08/08 07:46:40.516641 client.go:652: INFO Connected to Elasticsearch version 5.5.0
2017/08/08 07:46:40.516666 output.go:214: INFO Trying to load template for client: http://localhost:9200
2017/08/08 07:46:40.518197 output.go:235: INFO Template already exists and will not be overwritten.
panic: interface conversion: interface {} is nil, not string

goroutine 39 [running]:
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/elasticsearch.eventBulkMeta(0xbfc600, 0xc42018e800, 0x0, 0xc42045ee40, 0x0, 0x0, 0x0)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/elasticsearch/client.go:317 +0x121
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/elasticsearch.bulkEncodePublishRequest(0x7f4e810a2440, 0xc4201980f8, 0xbfc600, 0xc42018e800, 0x0, 0xc4201a2380, 0x1, 0x32, 0xc42019a2f0, 0x147, ...)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/elasticsearch/client.go:290 +0xd6
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/elasticsearch.(*Client).PublishEvents(0xc4201be140, 0xc4201a2380, 0x1, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/elasticsearch/client.go:235 +0x138
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/mode/single.(*Mode).PublishEvents.func1(0xc4201c6780)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/mode/single/single.go:89 +0x7b
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/mode/single.(*Mode).publish(0xc4201c6780, 0x0, 0x0, 0x7f4e8116de00, 0xc4201afb88, 0xc42046a000, 0x0)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/mode/single/single.go:144 +0x290
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/mode/single.(*Mode).PublishEvents(0xc4201c6780, 0x0, 0x0, 0x0, 0xc4201a2380, 0x1, 0x32, 0x1, 0x1)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/mode/single/single.go:99 +0x7d
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/elasticsearch.(*elasticsearchOutput).BulkPublish(0xc42019a280, 0x0, 0x0, 0x0, 0xc4201a2380, 0x1, 0x32, 0xc42003ffbe, 0xc42003ff28)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/outputs/elasticsearch/output.go:308 +0x79
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher.(*outputWorker).sendBulk(0xc4201903c0, 0xc42003fd38, 0xc4201a2380, 0x1, 0x32)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher/output.go:112 +0x123
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher.(*outputWorker).onBulk(0xc4201903c0, 0xc42003fd38, 0xc4201a2380, 0x1, 0x32)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher/output.go:88 +0x281
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher.(*outputWorker).onMessage(0xc4201903c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4201a2380, 0x1, 0x32)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher/output.go:70 +0x9a
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher.(*messageWorker).onEvent(0xc4201903c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4201a2380, 0x1, 0x32)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher/worker.go:83 +0x74
github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher.(*messageWorker).run(0xc4201903c0)
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher/worker.go:69 +0x290
created by github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher.(*messageWorker).init
/home/hp/src/github.com/bob96/hc34/vendor/github.com/elastic/beats/libbeat/publisher/worker.go:57 +0x107

can someone help me please
best regards!


(Steffen Siering) #2

The line reported does not match any lines in 5.5 branch. Which commit ID are you using? Consider updating the vendored beats to most recent 5.5 or 5.6 commit.

The closest possible issue with a potential matching panic is this line (5.4 branch): https://github.com/elastic/beats/blob/5.4/libbeat/outputs/elasticsearch/client.go#L323

This indicates the event["type"] field is missing. With most recent 5.5 branch, this field is not mandatory anymore.


(system) #3

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