vectordotdev / vectordotdev/vector

Improve error when a table is passed for a single key

Open
#2,066 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

domain: config have: nice
Dominant language
Rust
Stars
22.6k
Forks
2.3k
Avg merge
1d 7h
Merged PRs (30d)
146

Description

I attempted to use a Vector config that included the new encoding table but it was on an older version of Vector. It produced the following configuration error:

[sinks.company_api_http]
type = "http"
inputs = ["company_api_rename"]
uri = "http://{{ consumer_instance.ec2_private_ip_address }}:{{ consumer_port }}"

[sinks.company_api_http.encoding]
except_fields = ["metadata.shard[0]", "metadata.shard[1]"]

The valid config is:

[sinks.company_api_http]
type = "http"
inputs = ["company_api_rename"]
uri = "http://{{ consumer_instance.ec2_private_ip_address }}:{{ consumer_port }}"
encoding.format = "json"
Mar 14 17:39:21 ip-10-0-131-11 vector[11926]: Mar 14 17:39:21.233 ERROR vector: Configuration error: "/etc/vector/vector.toml": invalid value: map, expected map with a single key for key `sinks.company_api_http`

This is not very descriptive of the error. It should probably be something like:

Mar 14 17:39:21 ip-10-0-131-11 vector[11926]: Mar 14 17:39:21.233 ERROR vector: Configuration error: "/etc/vector/vector.toml": invalid value: map, expected map with a single key for encoding `sinks.company_api_http`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the configuration error with the shown sinks.company_api_http.encoding table on an older Vector version, then trace the configuration parsing path that emits the single-key map message. Update the error so it identifies encoding, and verify the revised wording against the provided configuration example.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.