telegraf/plugins/inputs
Sam Lai 35a221018b
[http_listener_v2] Stop() succeeds even if fails to start (#8502)
* [http_listener_v2] Stop() succeeds even if fails to start

In cases where the http_listener_v2 plugin config is invalid, when the agent attempts to cleanup by stopping all the inputs, the Stop method here panics as it tries to call listener.Stop() when no listener has been set. This also masks the error message returned from the Start method.

```
> telegraf --test
2020-10-27T12:21:45Z I! Starting Telegraf 1.16.0
2020-10-27T12:21:45Z I! Using config file: /etc/telegraf/telegraf.conf
...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1245130]

goroutine 45 [running]:
github.com/influxdata/telegraf/plugins/inputs/http_listener_v2.(*HTTPListenerV2).Stop(0xc00043e000)
        /go/src/github.com/influxdata/telegraf/plugins/inputs/http_listener_v2/http_listener_v2.go:178 +0x30
github.com/influxdata/telegraf/agent.stopServiceInputs(0xc00045e480, 0x5, 0x8)
        /go/src/github.com/influxdata/telegraf/agent/agent.go:445 +0x82
github.com/influxdata/telegraf/agent.(*Agent).testRunInputs(0xc000288080, 0x32be8c0, 0xc0000f1f00, 0x0, 0xc00000f480, 0x0, 0x0)
        /go/src/github.com/influxdata/telegraf/agent/agent.go:434 +0x1b7
github.com/influxdata/telegraf/agent.(*Agent).test.func4(0xc000057b70, 0xc000288080, 0x32be8c0, 0xc0000f1f00, 0x0, 0xc00000f480)
        /go/src/github.com/influxdata/telegraf/agent/agent.go:977 +0x8b
created by github.com/influxdata/telegraf/agent.(*Agent).test
        /go/src/github.com/influxdata/telegraf/agent/agent.go:975 +0x352
```

This fixes this issue by checking if the listener has been set before calling listener.Stop.

```
> ./telegraf --config test.conf --test
2020-10-27T12:43:25Z I! Starting Telegraf
2020-10-27T12:43:25Z E! [agent] Starting input inputs.http_listener_v2: listen tcp: address address_without_port: missing port in address
```

* retry CI
2020-12-23 09:09:42 -06:00
..
activemq Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
aerospike fix edge case in aerospike plugin where an expected hex string was converted to integer if all digits (#8542) 2020-12-10 17:38:21 -05:00
all New Intel PowerStat input plugin (#8488) 2020-12-10 13:23:27 -07:00
amqp_consumer Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
apache Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
apcupsd Update mdlayher/apcupsd dependency (#8444) 2020-11-20 13:54:56 -05:00
aurora Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
azure_storage_queue fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
bcache Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
beanstalkd Add Beanstalkd input plugin (#4272) 2018-09-10 11:51:03 -07:00
bind Add configurable timeout to bind input plugin http call (#8508) 2020-12-03 13:42:50 -06:00
bond Update bond input description 2017-12-14 16:03:29 -08:00
burrow fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
cassandra fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
ceph Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
cgroup fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
chrony Search for chronyc only when chrony input plugin is enabled (#7005) 2020-02-10 14:22:07 -08:00
cisco_telemetry_mdt fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
clickhouse add additional metrics to clickhouse input plugin (#7904) 2020-08-12 11:48:07 -04:00
cloud_pubsub fix typo in cloud_pubsub docs (#7815) 2020-07-10 11:34:56 -04:00
cloud_pubsub_push fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
cloudwatch Implement AWS CloudWatch Input Plugin ListMetrics API calls to use Active Metric Filter (#7894) 2020-09-29 16:31:38 -06:00
conntrack fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
consul input consul - added metric_version flag (#7875) 2020-10-07 11:31:02 -04:00
couchbase fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
couchdb Add support for basic auth to couchdb input (#5160) 2018-12-19 12:59:27 -08:00
cpu Unify comments style in the CPU input (#8605) 2020-12-21 15:44:51 -05:00
dcos Update jwt-go module to address CVE-2020-26160 (#8337) 2020-11-02 09:07:37 -07:00
disk Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
diskio Fix typo in queue depth example of diskio plugin (#7613) 2020-06-02 23:11:13 -07:00
disque fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
dmcache Fix dmcache tests with 32bit int 2017-09-26 15:25:57 -07:00
dns_query Fix spelling errors in comments and documentation (#7492) 2020-05-14 00:41:58 -07:00
docker Fix vulnerabilities found in BDBA scan (#8199) 2020-09-30 13:24:10 -04:00
docker_log Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
dovecot fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
ecs Remove duplicated field "revision" from ecs_task because it's already defined as a tag there (#8574) 2020-12-16 13:23:31 -05:00
elasticsearch Add configurable number of 'most recent' date-stamped indices to gather in Elasticsearch input (#8543) 2020-12-21 11:45:19 -05:00
ethtool [ethtool] interface_up field added (#8590) 2020-12-18 12:04:02 -05:00
eventhub_consumer Fix string to int conversion in eventhub consumer (#8006) 2020-08-26 09:26:37 -06:00
exec Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
execd Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
fail2ban Update fail2ban readme 2019-08-02 12:35:43 -07:00
fibaro Fix interfaces with pointers (#7411) 2020-04-27 11:52:24 -04:00
file Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
filecount Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
filestat Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
fireboard Fix assorted spelling mistakes (#7507) 2020-05-15 15:43:32 -07:00
fluentd Fix spelling errors in comments and documentation (#7492) 2020-05-14 00:41:58 -07:00
github [inputs.github] Add query of pull-request statistics (#8500) 2020-12-10 15:23:57 -05:00
gnmi Log SubscribeResponse_Error message and code. #8482 (#8483) 2020-11-30 12:12:10 -05:00
graylog Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
haproxy Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
hddtemp Add source tag to hddtemp plugin (#5955) 2019-06-05 12:47:17 -07:00
http proxy support for http input (#8477) 2020-11-26 17:16:25 -05:00
http_listener_v2 [http_listener_v2] Stop() succeeds even if fails to start (#8502) 2020-12-23 09:09:42 -06:00
http_response fixed network test (#8498) 2020-12-04 12:08:11 -05:00
httpjson Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
icinga2 fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
infiniband Update documentation for infiniband plugin 2020-01-16 13:56:23 -08:00
influxdb update inputs.influxdb readme (#8569) 2020-12-17 08:21:45 -08:00
influxdb_listener Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
influxdb_v2_listener change influxdb port 9999 to 8086 (#8198) 2020-10-07 11:54:51 -04:00
intel_powerstat New Intel PowerStat input plugin (#8488) 2020-12-10 13:23:27 -07:00
intel_rdt cleanup Intel RDT readme (#8268) 2020-10-15 09:09:09 -07:00
internal fix(readmes): updates to internal and proxmox readmes (#7982) 2020-08-13 23:50:09 -04:00
interrupts Restore field name case in interrupts input (#5850) 2019-05-14 11:56:19 -07:00
ipmi_sensor Add hex_key parameter for IPMI input plugin connection (#8524) 2020-12-21 11:45:58 -05:00
ipset fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
iptables fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
ipvs Improve ipvs input error strings and logging (#6530) 2019-10-21 21:27:05 -07:00
jenkins feat: add build number field to jenkins_job measurement (#8038) 2020-12-10 12:02:07 -05:00
jolokia Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
jolokia2 Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
jti_openconfig_telemetry Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
kafka_consumer Enable kafka zstd compression and idempotent writes (#8435) 2020-11-23 15:51:58 -05:00
kafka_consumer_legacy fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
kapacitor fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
kernel Moved system package inputs out to top level (#4406) 2018-07-11 16:43:49 -07:00
kernel_vmstat Moved system package inputs out to top level (#4406) 2018-07-11 16:43:49 -07:00
kibana Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
kinesis_consumer Fix assorted spelling mistakes (#7507) 2020-05-15 15:43:32 -07:00
kube_inventory Fixing issue with missing metrics when pod has only pending containers (#8472) 2020-12-11 09:08:30 -05:00
kubernetes [fix] add missing error check for HTTP req failure (#8071) 2020-09-08 14:13:23 -04:00
lanz fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
leofs Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
linux_sysctl_fs fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
logparser Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
logstash Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
lustre2 Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
mailchimp fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
marklogic fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
mcrouter Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
mem fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
memcached Collect additional stats in memcached input (#4914) 2018-10-24 15:02:44 -07:00
mesos Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
minecraft fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
modbus Add FLOAT64-IEEE support to inputs.modbus (#8361) (by @Nemecsek) (#8474) 2020-11-30 16:22:57 -05:00
mongodb MongoDB: Added new metric "pages written from cache" (#7870) 2020-07-27 23:45:37 -04:00
monit Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
mqtt_consumer fix issue with mqtt concurrent map write (#8562) 2020-12-16 15:38:33 -05:00
multifile Fix spelling errors in comments and documentation (#7492) 2020-05-14 00:41:58 -07:00
mysql Add per user metrics to mysql input (#6132) 2020-12-15 08:59:52 -07:00
nats Add support for credentials file to nats_consumer and nats output (#7022) 2020-02-20 14:30:04 -08:00
nats_consumer Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
neptune_apex fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
net fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
net_response Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
nginx fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
nginx_plus fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
nginx_plus_api fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
nginx_sts Add minimum version for new plugins (#7810) 2020-07-09 11:29:12 -07:00
nginx_upstream_check fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
nginx_vts fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
nsd add nsd input plugin (#7822) 2020-09-04 14:56:25 -06:00
nsq Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
nsq_consumer resolves issues where failed api calls lead to obscure errors (#7051) 2020-02-19 21:46:08 -05:00
nstat fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
ntpq fix concurrency panic in ntpq input. Closes #7101 (#7143) 2020-03-10 16:48:30 -04:00
nvidia_smi Add DriverVersion and CUDA Version to output (#8436) 2020-11-19 09:52:47 -07:00
opcua Add node groups to opcua input plugin (#8389) 2020-12-02 17:06:47 -07:00
openldap Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
openntpd Fix assorted spelling mistakes (#7507) 2020-05-15 15:43:32 -07:00
opensmtpd Fix spelling errors in comments and documentation (#7492) 2020-05-14 00:41:58 -07:00
openweathermap Use 1h or 3h rain values as appropriate (#6593) 2019-11-08 12:10:16 -08:00
passenger Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
pf fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
pgbouncer Fix spelling errors in comments and documentation (#7492) 2020-05-14 00:41:58 -07:00
phpfpm [php-fpm] Fix possible "index out of range" (#8461) 2020-11-23 17:21:36 -05:00
ping fix potential issue with race condition (#8577) 2020-12-16 15:39:12 -05:00
postfix Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
postgresql fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
postgresql_extensible fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
powerdns Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
powerdns_recursor Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
processes processes: fix issue with stat no such file/dir (#8309) 2020-10-26 11:35:10 -04:00
procstat Removed outdated information about Windows support (#7971) 2020-11-27 16:15:11 -05:00
prometheus Add a parser plugin for prometheus (#7778) 2020-12-02 12:48:44 -07:00
proxmox proxmox: ignore QEMU templates and iron out a few bugs (#8326) 2020-11-12 18:12:29 -05:00
puppetagent fix(puppet): update broken link (#7977) 2020-08-12 10:09:04 -04:00
rabbitmq rabbitmq: remove deprecated healthcheck (#7823) (#7920) 2020-08-10 13:02:38 -04:00
raindrops Fix telegraf example arguments (#2788) 2017-05-12 15:22:29 -07:00
ras fix plugins/input/ras test (#8350) 2020-11-02 10:17:54 -05:00
redfish Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
redis Fix minor typos in readmes (#8370) 2020-11-12 10:20:50 -07:00
rethinkdb Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
riak fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
riemann_listener Support Riemann-Protobuff Listener (#8163) 2020-11-27 11:30:45 -05:00
salesforce Fix spelling errors in comments and documentation (#7492) 2020-05-14 00:41:58 -07:00
sensors fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
sflow Sflow rework (#7253) 2020-04-29 17:28:55 -04:00
smart Fix SMART plugin to recognize all devices from config (#8374) 2020-11-12 11:04:52 -05:00
snmp Add support to convert snmp hex strings to integers (#8426) 2020-12-07 14:45:06 -07:00
snmp_legacy Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
snmp_trap If the community string is available, add it as a tag (#8189) 2020-09-29 10:23:23 -04:00
socket_listener fix crash when socket_listener receiving invalid data (#8551) 2020-12-15 13:52:48 -05:00
solr fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
sqlserver Added tags for monitoring readable secondaries for Azure SQL MI (#8369) 2020-12-08 15:42:31 -05:00
stackdriver Fix data race in plugins/inputs/stackdriver/stackdriver_test.go (#7744) 2020-06-25 10:37:29 -07:00
statsd Add configurable Max TTL duration for statsd input plugin entries (#8509) 2020-12-04 14:39:00 -05:00
suricata changed TestThreadStats acc to wait for 2 and added warning comment (#8592) 2020-12-17 19:32:49 -05:00
swap Add more detailed descriptions for fields in swap input (#4763) 2018-10-18 12:59:03 -07:00
synproxy fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
syslog Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
sysstat Document and add support to input plugins for logging alias (#6357) 2019-09-23 15:39:50 -07:00
system Document and add support to input plugins for logging alias (#6357) 2019-09-23 15:39:50 -07:00
systemd_units systemd_units: add --plain to command invocation (#7990) (#7991) 2020-11-12 15:51:44 -05:00
tail Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
tcp_listener misc tests 2020-11-03 16:02:34 -05:00
teamspeak fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
temp fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
tengine Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
tomcat Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
trig Seems to be a toml parse bug around triple pounds 2016-02-18 14:36:03 -07:00
twemproxy Seems to be a toml parse bug around triple pounds 2016-02-18 14:36:03 -07:00
udp_listener fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
unbound Fix spelling errors in comments and documentation (#7492) 2020-05-14 00:41:58 -07:00
uwsgi fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
varnish Fix assorted spelling mistakes (#7507) 2020-05-15 15:43:32 -07:00
vsphere Fixed misspelled check for datacenter (#8505) 2020-12-10 12:02:36 -05:00
webhooks fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
win_eventlog Fix Event timestamps (#8216) 2020-10-19 12:24:46 -04:00
win_perf_counters Fix minor typos in readmes (#8370) 2020-11-12 10:20:50 -07:00
win_services Added Glob pattern matching for "Windows Services" plugin (#8575) 2020-12-16 14:32:29 -06:00
wireguard plugins/inputs: New input for Wireguard server (#6367) 2020-03-09 18:34:43 -04:00
wireless Show platform not supported warning only on plugin creation (#6801) 2020-01-02 16:15:48 -08:00
x509_cert Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
zfs Add dataset metrics to zfs input (#8383) 2020-11-27 13:58:32 -05:00
zipkin fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
zookeeper fix(readmes): standarize first line of readmes (#7973) 2020-08-11 16:10:41 -04:00
EXAMPLE_README.md Add sFlow input plugin (#7188) 2020-03-18 12:12:24 -07:00
mock_Plugin.go Add initialization example to mock-plugin. (#8520) 2020-12-07 17:43:15 -05:00
registry.go Create public models for telegraf metrics, accumlator, plugins 2016-01-27 15:42:50 -07:00