From bc144e2b0558dd94e0343db0a370340854c01029 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 8 Mar 2023 01:26:53 -0800 Subject: [PATCH] all: follow-up for 7a3e16e77476a8b678be455728c0e47611359261 - Sync the description for -httpListenAddr.useProxyProtocol command-line flag at vmagent and vmauth, so it is consistent with the description at vmauth and victoria-metrics - Add a sample of panic text to docs/CHANGELOG.md, so it could be googled - Mention the -httpListenAddr.useProxyProtocol command-line flag in the description for the bugfix Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335 --- app/vmagent/main.go | 3 ++- app/vmalert/main.go | 3 ++- app/vmauth/main.go | 4 ++-- app/vminsert/main.go | 3 ++- app/vmselect/main.go | 3 ++- app/vmstorage/main.go | 3 ++- docs/CHANGELOG.md | 2 +- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/vmagent/main.go b/app/vmagent/main.go index 7b01e734c..224321bc3 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -46,7 +46,8 @@ var ( "Set this flag to empty value in order to disable listening on any port. This mode may be useful for running multiple vmagent instances on the same server. "+ "Note that /targets and /metrics pages aren't available if -httpListenAddr=''. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") influxListenAddr = flag.String("influxListenAddr", "", "TCP and UDP address to listen for InfluxDB line protocol data. Usually :8089 must be set. Doesn't work if empty. "+ "This flag isn't needed when ingesting data over HTTP - just send it to http://:8429/write . "+ "See also -influxListenAddr.useProxyProtocol") diff --git a/app/vmalert/main.go b/app/vmalert/main.go index 5278c51c8..e627d871c 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -51,7 +51,8 @@ absolute path to all .tpl files in root.`) httpListenAddr = flag.String("httpListenAddr", ":8880", "Address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") evaluationInterval = flag.Duration("evaluationInterval", time.Minute, "How often to evaluate the rules") validateTemplates = flag.Bool("rule.validateTemplates", true, "Whether to validate annotation and label templates") diff --git a/app/vmauth/main.go b/app/vmauth/main.go index 01c633a5f..3bf230bde 100644 --- a/app/vmauth/main.go +++ b/app/vmauth/main.go @@ -28,8 +28,8 @@ import ( var ( httpListenAddr = flag.String("httpListenAddr", ":8427", "TCP address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt."+ - "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing.") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") maxIdleConnsPerBackend = flag.Int("maxIdleConnsPerBackend", 100, "The maximum number of idle connections vmauth can open per each backend host. "+ "See also -maxConcurrentRequests") responseTimeout = flag.Duration("responseTimeout", 5*time.Minute, "The timeout for receiving a response from backend") diff --git a/app/vminsert/main.go b/app/vminsert/main.go index bc376f1b5..20968aa8b 100644 --- a/app/vminsert/main.go +++ b/app/vminsert/main.go @@ -68,7 +68,8 @@ var ( "at -opentsdbHTTPListenAddr . See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") httpListenAddr = flag.String("httpListenAddr", ":8480", "Address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") maxLabelsPerTimeseries = flag.Int("maxLabelsPerTimeseries", 30, "The maximum number of labels accepted per time series. Superfluous labels are dropped. In this case the vm_metrics_with_dropped_labels_total metric at /metrics page is incremented") maxLabelValueLen = flag.Int("maxLabelValueLen", 16*1024, "The maximum length of label values in the accepted time series. Longer label values are truncated. In this case the vm_too_long_label_values_total metric at /metrics page is incremented") storageNodes = flagutil.NewArrayString("storageNode", "Comma-separated addresses of vmstorage nodes; usage: -storageNode=vmstorage-host1,...,vmstorage-hostN . "+ diff --git a/app/vmselect/main.go b/app/vmselect/main.go index 145e5cb95..e7656ecfd 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -40,7 +40,8 @@ import ( var ( httpListenAddr = flag.String("httpListenAddr", ":8481", "Address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") cacheDataPath = flag.String("cacheDataPath", "", "Path to directory for cache files. Cache isn't saved if empty") maxConcurrentRequests = flag.Int("search.maxConcurrentRequests", getDefaultMaxConcurrentRequests(), "The maximum number of concurrent search requests. "+ "It shouldn't be high, since a single request can saturate all the CPU cores, while many concurrently executed requests may require high amounts of memory. "+ diff --git a/app/vmstorage/main.go b/app/vmstorage/main.go index 4ff97744f..d859ab6d3 100644 --- a/app/vmstorage/main.go +++ b/app/vmstorage/main.go @@ -28,7 +28,8 @@ var ( retentionPeriod = flagutil.NewDuration("retentionPeriod", "1", "Data with timestamps outside the retentionPeriod is automatically deleted. See also -retentionFilter") httpListenAddr = flag.String("httpListenAddr", ":8482", "Address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") storageDataPath = flag.String("storageDataPath", "vmstorage-data", "Path to storage data") vminsertAddr = flag.String("vminsertAddr", ":8400", "TCP address to accept connections from vminsert services") vmselectAddr = flag.String("vmselectAddr", ":8401", "TCP address to accept connections from vmselect services") diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 101e40175..905c96138 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -17,7 +17,7 @@ The following tip changes can be tested by building VictoriaMetrics components f * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): do not register `vm_promscrape_config_*` metrics if `-promscrape.config` flag is not used. Previously those metrics were registered and never updated, which was confusing and could trigger false-positive alerts. * BUGFIX: [vmctl](https://docs.victoriametrics.com/vmctl.html): skip measurements with no fields when migrating data from influxdb. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3837). -* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html) fixes possible panic with enabled proxy-protocol. It was introduced at [v1.87.0](https://docs.victoriametrics.com/CHANGELOG.html#v1870) when implementing [this feature](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335). +* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html): fix `cannot serve http` panic when plain HTTP request is sent to `vmauth` configured to accept requests over [proxy protocol](https://www.haproxy.org/download/2.3/doc/proxy-protocol.txt)-encoded request (e.g. when `vmauth` runs with `-httpListenAddr.useProxyProtocol` command-line flag). The issue has been introduced at [v1.87.0](https://docs.victoriametrics.com/CHANGELOG.html#v1870) when implementing [this feature](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335). ## [v1.87.2](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.87.2)