Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegraf doesn't error on unused #12000

Closed
Hipska opened this issue Oct 12, 2022 · 4 comments · Fixed by #12063
Closed

Telegraf doesn't error on unused #12000

Hipska opened this issue Oct 12, 2022 · 4 comments · Fixed by #12063
Assignees
Labels
area/configuration bug unexpected problem or unintended behavior regression something that used to work, but is now broken

Comments

@Hipska
Copy link
Contributor

Hipska commented Oct 12, 2022

Relevant telegraf.conf

[[inputs.file]]
  file = "Nonexisting.txt"

Logs from Telegraf

2022-10-12T20:18:14Z I! Starting Telegraf 1.24.2
2022-10-12T20:18:14Z I! Available plugins: 208 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-10-12T20:18:14Z I! Loaded inputs: file
2022-10-12T20:18:14Z I! Loaded aggregators: 
2022-10-12T20:18:14Z I! Loaded processors: 
2022-10-12T20:18:14Z W! Outputs are not used in testing mode!
2022-10-12T20:18:14Z I! Tags enabled: host=Thomas-MacBook-Pro.local
2022-10-12T20:18:14Z D! [agent] Initializing plugins
2022-10-12T20:18:14Z D! [agent] Starting service inputs
2022-10-12T20:18:14Z D! [agent] Stopping service inputs
2022-10-12T20:18:14Z D! [agent] Input channel closed
2022-10-12T20:18:14Z D! [agent] Stopped Successfully

System info

Telegraf 1.24.0

Docker

No response

Steps to reproduce

  1. Create config with wrong config option name
  2. Run telegraf

Expected behavior

Error loading config file test.toml: plugin inputs.file: line 1: configuration specified the fields ["file"], but they weren't used

Actual behavior

No relevant error observed.

Additional info

Works as expected in telegraf 1.23.4

@Hipska Hipska added the bug unexpected problem or unintended behavior label Oct 12, 2022
@powersj
Copy link
Contributor

powersj commented Oct 12, 2022

Looks like v1.23.4 is the last working version as well. My local v1.24.0 and v1.24.1 builds both failed.

Here is the diff from v1.23.4 to v1.24.0:
v1.23.4...v1.24.0

@Hipska also pointed out that there is a test for unused fields, but when running telegraf it is not present

3ad9fe7 is the commit that breaks this behavior. The previous commits that day ff17ede and fd84042 both correctly fail on start.

@powersj
Copy link
Contributor

powersj commented Oct 12, 2022

ok I know where it is not correctly calling missingTomlField: in config.go we check if a field hits a certain miss count threshold. It is now hard-coded if the miscount is 0 or 1, we continue on.

However, in the old code, the miss count threshold could either be 0 or 1 depending on different scenarios.

@srebhan sorry to ping you on yet another one, I need to dig into this further, but maybe you know why it was hardcoded in the new version?

@Hipska
Copy link
Contributor Author

Hipska commented Oct 13, 2022

I just tested, but even with 2 or 3 unknown extra config parameters, no error/warning is given..

@AlbertasB
Copy link
Contributor

I wasted so much time due to this :(

@srebhan srebhan self-assigned this Oct 18, 2022
@srebhan srebhan added the regression something that used to work, but is now broken label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration bug unexpected problem or unintended behavior regression something that used to work, but is now broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants