vector icon indicating copy to clipboard operation
vector copied to clipboard

Cannot specify the large values for configuration fields defined as u64

Open jszwedko opened this issue 3 years ago • 1 comments

For the http sink, request.rate_limit_num is defined as a uint64, but it doesn't look like you can actually specify the max uint64 value: 18446744073709551615

Vector Version

vector 0.11.0 (gea01563 x86_64-unknown-linux-gnu 2020-08-19)

Vector Configuration File

[sources.generator]
  type = "generator"
  lines = ["Line 1", "Line 2"]
  batch_interval = 1

[sinks.http]
  type = "http"
  inputs = ["generator"]
  uri = "http://localhost:8080"
  request.rate_limit_num = 18446744073709551615

Debug Output

➜  vector git:(master) vector --config /tmp/test.toml -vvv
Aug 19 11:27:58.881  INFO vector: Log level "trace" is enabled.
Aug 19 11:27:58.897  INFO vector: Loading configs. path=["/tmp/test.toml"]
Aug 19 11:27:58.897 TRACE vector::config::loading: Parsing config. path="/tmp/test.toml"
Aug 19 11:27:58.914 ERROR vector: Configuration error: "/tmp/test.toml": invalid number at line 10

Expected Behavior

No error

Actual Behavior

Error parsing configuration file

jszwedko avatar Aug 19 '20 15:08 jszwedko

This looks like an issue with the TOML parsing library, https://github.com/alexcrichton/toml-rs/issues/256, where it always parses integers as signed i64s.

jszwedko avatar Aug 19 '20 15:08 jszwedko

Closing this since they don't plan to change this behavior upstream and the error message we get is better now:

2023-07-24T16:29:27.132160Z ERROR vector::cli: Configuration error. error=TOML parse error at line 10, column 28
   |
10 |   request.rate_limit_num = 18446744073709551615
   |                            ^
number too large to fit in target type

jszwedko avatar Jul 24 '23 16:07 jszwedko