crowdsecurity/crowdsec · error
invalid DSN %s for VictoriaLogs source, must start with vict
Error message
invalid DSN %s for VictoriaLogs source, must start with victorialogs://
What it means
ConfigureByDSN parsed the DSN but its scheme is not 'victorialogs'. The VictoriaLogs datasource only accepts DSNs of the form victorialogs://host[:port], so any http://, https:// or other scheme is rejected explicitly.
Source
Thrown at pkg/acquisition/modules/victorialogs/config.go:130
s.Client.Logger = logger.WithFields(log.Fields{"component": "victorialogs-client", "source": s.Config.URL})
return nil
}
func (s *Source) ConfigureByDSN(_ context.Context, dsn string, labels map[string]string, logger *log.Entry, uuid string) error {
s.logger = logger
s.Config = Configuration{}
s.Config.Mode = configuration.CAT_MODE
s.Config.Labels = labels
s.Config.UniqueId = uuid
u, err := url.Parse(dsn)
if err != nil {
return fmt.Errorf("while parsing dsn '%s': %w", dsn, err)
}
if u.Scheme != "victorialogs" {
return fmt.Errorf("invalid DSN %s for VictoriaLogs source, must start with victorialogs://", dsn)
}
if u.Host == "" {
return errors.New("empty host")
}
scheme := "http"
params := u.Query()
if q := params.Get("ssl"); q != "" {
scheme = "https"
}
if q := params.Get("query"); q != "" {
s.Config.Query = q
}
View on GitHub (pinned to 909b515798)
Solutions
- Prefix the DSN with victorialogs:// — e.g. victorialogs://vl-host:9428.
- Do not use http:// or https://; the scheme and host/port mapping are handled by the source itself.
- Keep the scheme lowercase and include the '//' separator so url.Parse reports it correctly.
Example fix
// before http://vl-host:9428 // after victorialogs://vl-host:9428
Defensive patterns
Strategy: validation
Validate before calling
u, err := url.Parse(dsn)
if err != nil || u.Scheme != "victorialogs" || u.Host == "" {
return fmt.Errorf("DSN must be victorialogs://host[:port], got %q", dsn)
} Try / catch
u, err := url.Parse(dsn)
if err != nil {
return err
}
if u.Scheme != "victorialogs" {
log.Errorf("wrong scheme %q: use victorialogs://", u.Scheme)
return err
} Prevention
- Always write DSNs as victorialogs://host:port, lowercase, with '://'.
- Do not paste raw http:// endpoint URLs as DSNs.
- Document the expected DSN form where operators configure acquis.yaml.
When it happens
Trigger: Passing a DSN like 'http://vl:9428' or 'victorialogs:host' (missing //) to ConfigureByDSN; u.Scheme check fails and this static error is returned.
Common situations: Reusing an elasticsearch/Loki datasource URL as the DSN; writing the scheme without '://' so url.Parse assigns the wrong scheme or no scheme; case issues (VictoriaLogs://) since the check is exact.
Understand the failure class
Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.
Related errors
- while parsing dsn '%s': %w
- empty loki host
- failed to parse DSN %s: %w
- query is mandatory (at least start_date and end_date or back
- cloudwatch path must contain group and stream : /my/group/na
AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06).
Data as JSON: /api/errors/eb9ed686240ab579.
Report an issue: GitHub.