{"record":{"id":"eb9ed686240ab579","repo":"crowdsecurity/crowdsec","slug":"invalid-dsn-s-for-victorialogs-source-must-start","errorCode":null,"errorMessage":"invalid DSN %s for VictoriaLogs source, must start with victorialogs://","messagePattern":"invalid DSN (.+?) for VictoriaLogs source, must start with victorialogs://","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/victorialogs/config.go","lineNumber":130,"sourceCode":"\ts.Client.Logger = logger.WithFields(log.Fields{\"component\": \"victorialogs-client\", \"source\": s.Config.URL})\n\n\treturn nil\n}\n\nfunc (s *Source) ConfigureByDSN(_ context.Context, dsn string, labels map[string]string, logger *log.Entry, uuid string) error {\n\ts.logger = logger\n\ts.Config = Configuration{}\n\ts.Config.Mode = configuration.CAT_MODE\n\ts.Config.Labels = labels\n\ts.Config.UniqueId = uuid\n\n\tu, err := url.Parse(dsn)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"while parsing dsn '%s': %w\", dsn, err)\n\t}\n\n\tif u.Scheme != \"victorialogs\" {\n\t\treturn fmt.Errorf(\"invalid DSN %s for VictoriaLogs source, must start with victorialogs://\", dsn)\n\t}\n\n\tif u.Host == \"\" {\n\t\treturn errors.New(\"empty host\")\n\t}\n\n\tscheme := \"http\"\n\n\tparams := u.Query()\n\n\tif q := params.Get(\"ssl\"); q != \"\" {\n\t\tscheme = \"https\"\n\t}\n\n\tif q := params.Get(\"query\"); q != \"\" {\n\t\ts.Config.Query = q\n\t}\n","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/victorialogs/config.go#L112-L148","documentation":"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.","triggerScenarios":"Passing a DSN like 'http://vl:9428' or 'victorialogs:host' (missing //) to ConfigureByDSN; u.Scheme check fails and this static error is returned.","commonSituations":"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.","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."],"exampleFix":"// before\nhttp://vl-host:9428\n\n// after\nvictorialogs://vl-host:9428","handlingStrategy":"validation","validationCode":"u, err := url.Parse(dsn)\nif err != nil || u.Scheme != \"victorialogs\" || u.Host == \"\" {\n    return fmt.Errorf(\"DSN must be victorialogs://host[:port], got %q\", dsn)\n}","typeGuard":null,"tryCatchPattern":"u, err := url.Parse(dsn)\nif err != nil {\n    return err\n}\nif u.Scheme != \"victorialogs\" {\n    log.Errorf(\"wrong scheme %q: use victorialogs://\", u.Scheme)\n    return err\n}","preventionTips":["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."],"tags":["config","url","victorialogs","dsn"],"backgroundTag":"invalid-url","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}