{"record":{"id":"7508d739df67f9fd","repo":"crowdsecurity/crowdsec","slug":"listen-addr-or-listen-socket-is-required","errorCode":null,"errorMessage":"listen_addr or listen_socket is required","messagePattern":"listen_addr or listen_socket is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/http/config.go","lineNumber":96,"sourceCode":"\tif c.MaxBodySize == nil {\n\t\tc.MaxBodySize = new(defaultMaxBodySize)\n\t}\n}\n\nfunc (s *Source) UnmarshalConfig(yamlConfig []byte) error {\n\tcfg, err := ConfigurationFromYAML(yamlConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.Config = cfg\n\n\treturn nil\n}\n\nfunc (c *Configuration) Validate() error {\n\tif c.ListenAddr == \"\" && c.ListenSocket == \"\" {\n\t\treturn errors.New(\"listen_addr or listen_socket is required\")\n\t}\n\n\tif c.Path[0] != '/' {\n\t\treturn errors.New(\"path must start with /\")\n\t}\n\n\tswitch c.AuthType {\n\tcase \"basic_auth\":\n\t\tbaseErr := \"basic_auth is selected, but\"\n\t\tif c.BasicAuth == nil {\n\t\t\treturn errors.New(baseErr + \" basic_auth is not provided\")\n\t\t}\n\n\t\tif c.BasicAuth.Username == \"\" {\n\t\t\treturn errors.New(baseErr + \" username is not provided\")\n\t\t}\n\n\t\tif c.BasicAuth.Password == \"\" {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/http/config.go#L78-L114","documentation":"Validation in Configuration.Validate for the HTTP acquisition source: neither listen_addr nor listen_socket is set, so the HTTP server has no place to listen for pushed logs. One of the two addressing options is mandatory before any other validation (path, auth) proceeds.","triggerScenarios":"Thrown at pkg/acquisition/modules/http/config.go:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set listen_addr: 0.0.0.0:8080 for a TCP listener, or listen_socket: /var/run/crowdsec-http.sock for a UNIX socket","Also ensure path starts with '/' and an auth_type is configured, or the next validation checks will fire"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}