crowdsecurity/crowdsec · error

VictoriaLogs url is mandatory

Error message

VictoriaLogs url is mandatory

What it means

The VictoriaLogs acquisition config requires a 'url' field pointing at the VictoriaLogs instance's query endpoint. UnmarshalConfig parses the YAML with strict mode and then validates required fields; an empty url aborts datasource configuration.

Source

Thrown at pkg/acquisition/modules/victorialogs/config.go:49

	Prefix                            string              `yaml:"prefix"` // VictoriaLogs prefix
	Query                             string              `yaml:"query"`  // LogsQL query
	Limit                             int                 `yaml:"limit"`  // Limit of logs to read
	Since                             time.Duration       `yaml:"since"`
	Headers                           map[string]string   `yaml:"headers"`        // HTTP headers for talking to VictoriaLogs
	WaitForReady                      time.Duration       `yaml:"wait_for_ready"` // Retry interval, default is 10 seconds
	Auth                              AuthConfiguration `yaml:"auth"`
	MaxFailureDuration                time.Duration       `yaml:"max_failure_duration"` // Max duration of failure before stopping the source
	configuration.DataSourceCommonCfg `yaml:",inline"`
}

func (s *Source) UnmarshalConfig(yamlConfig []byte) error {
	err := yaml.UnmarshalWithOptions(yamlConfig, &s.Config, yaml.Strict())
	if err != nil {
		return fmt.Errorf("cannot parse VictoriaLogs acquisition configuration: %s", yaml.FormatError(err, false, false))
	}

	if s.Config.URL == "" {
		return errors.New("VictoriaLogs url is mandatory")
	}

	if s.Config.Query == "" {
		return errors.New("VictoriaLogs query is mandatory")
	}

	if s.Config.WaitForReady == 0 {
		s.Config.WaitForReady = 10 * time.Second
	}

	if s.Config.Mode == "" {
		s.Config.Mode = configuration.TAIL_MODE
	}

	if s.Config.Prefix == "" {
		s.Config.Prefix = "/"
	}

View on GitHub (pinned to 909b515798)

Solutions

  1. Add the url key to the acquisition config, e.g. url: http://victorialogs:9428
  2. Verify the key spelling is exactly 'url'
  3. Validate the YAML loads against the source's expected schema

Example fix

// before
source: victorialogs
query: '*'
// after
source: victorialogs
url: http://victorialogs:9428
query: '*'
Defensive patterns

Strategy: validation

Validate before calling

// check config before applying
if cfg["url"] == "" { return errors.New("victorialogs url is required") }

Prevention

When it happens

Trigger: A VictoriaLogs acquisition YAML (data_source: victorialogs) parsed without a 'url:' key, or url left as empty string.

Common situations: Copy-pasting a config template without filling in the url; typo'd key like 'uri:' rejected by strict unmarshalling or silently empty; config generated by tooling omitting optional-looking fields.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06). Data as JSON: /api/errors/84239863318cebed. Report an issue: GitHub.