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

v1.32.X Windows logtarget setting deprecation seems like a breaking change #16100

Closed
Hr0bar opened this issue Oct 29, 2024 · 3 comments · Fixed by #16108
Closed

v1.32.X Windows logtarget setting deprecation seems like a breaking change #16100

Hr0bar opened this issue Oct 29, 2024 · 3 comments · Fixed by #16108
Assignees
Labels
bug unexpected problem or unintended behavior

Comments

@Hr0bar
Copy link
Contributor

Hr0bar commented Oct 29, 2024

Relevant telegraf.conf

# Configuration for telegraf agent
[agent]
  interval = "1m"
  round_interval = true
  metric_batch_size = 100
  metric_buffer_limit = 1000
  collection_jitter = "0s"
  flush_interval = "1m"
  flush_jitter = "0s"
  precision = ""
  hostname = ""
  omit_hostname = false
  logtarget = "eventlog"

Logs from Telegraf

[telegraf] Error running agent: contradicting setting between 'logtarget' and 'logformat'

System info

v1.32.2 Windows server 2019

Docker

No response

Steps to reproduce

  1. Upgrade from v1.31.2 to v1.32.2 on Windows, dont touch any configs
  2. telegraf.exe --service start
  3. Get startup error "[telegraf] Error running agent: contradicting setting between 'logtarget' and 'logformat'"
    ...

Expected behavior

Telegraf starts

Actual behavior

Telegraf doesnt start

Additional info

Hi, we upgraded telegraf on Windows from 1.31.2 to 1.32.2 and we get an error startup error that is supposed to be only a deprecation until v1.40.0:

	case "eventlog":
		msg := "Agent setting %q is deprecated, please set %q to %q and remove this setting!"
		deprecation := "The setting will be removed in v1.40.0."
		log.Printf("W! "+msg+" "+deprecation, "logtarget", "logformat", "eventlog")
		if cfg.LogFormat != "" && cfg.LogFormat != "eventlog" {
			return errors.New("contradicting setting between 'logtarget' and 'logformat'")
		}
		cfg.LogFormat = "eventlog"

We use the deprecated:
logtarget = "eventlog"

in config and we get the ""contradicting setting between 'logtarget' and 'logformat'"" startup error.

The issue is that we DO NOT set "logformat" anywhere so this error seems wrongly raised.

The error condition has "cfg.LogFormat != """ so it must be filled somehow to some default value and then this error is raised ?

@Hr0bar Hr0bar added the bug unexpected problem or unintended behavior label Oct 29, 2024
@srebhan
Copy link
Member

srebhan commented Oct 30, 2024

@Hr0bar found the issue, working on a fix...

@srebhan
Copy link
Member

srebhan commented Oct 30, 2024

@Hr0bar please test the binary in PR #16108, available as soon as CI finished the tests, and let me know if this fixes the issue!

@Hr0bar
Copy link
Contributor Author

Hr0bar commented Oct 31, 2024

Tested that build and works OK ! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants