{"record":{"id":"28166da694a6355d","repo":"crowdsecurity/crowdsec","slug":"no-configuration-paths-provided","errorCode":null,"errorMessage":"no configuration paths provided","messagePattern":"no configuration paths provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/csconfig/config_paths.go","lineNumber":21,"sourceCode":"import (\n\t\"errors\"\n\t\"path/filepath\"\n)\n\ntype ConfigurationPaths struct {\n\tConfigDir          string `yaml:\"config_dir\"`\n\tDataDir            string `yaml:\"data_dir,omitempty\"`\n\tSimulationFilePath string `yaml:\"simulation_path,omitempty\"`\n\tHubIndexFile       string `yaml:\"index_path,omitempty\"` // path of the .index.json\n\tHubDir             string `yaml:\"hub_dir,omitempty\"`\n\tPluginDir          string `yaml:\"plugin_dir,omitempty\"`\n\tNotificationDir    string `yaml:\"notification_dir,omitempty\"`\n\tPatternDir         string `yaml:\"pattern_dir,omitempty\"`\n}\n\nfunc (c *Config) loadConfigurationPaths() error {\n\tif c.ConfigPaths == nil {\n\t\treturn errors.New(\"no configuration paths provided\")\n\t}\n\n\tif c.ConfigPaths.ConfigDir == \"\" {\n\t\tc.ConfigPaths.ConfigDir = filepath.Dir(c.FilePath)\n\t}\n\n\tif c.ConfigPaths.DataDir == \"\" {\n\t\treturn errors.New(\"please provide a data directory with the 'data_dir' directive in the 'config_paths' section\")\n\t}\n\n\tif c.ConfigPaths.HubDir == \"\" {\n\t\tc.ConfigPaths.HubDir = filepath.Join(c.ConfigPaths.ConfigDir, \"hub\")\n\t}\n\n\tif c.ConfigPaths.HubIndexFile == \"\" {\n\t\tc.ConfigPaths.HubIndexFile = filepath.Join(c.ConfigPaths.HubDir, \".index.json\")\n\t}\n","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/csconfig/config_paths.go#L3-L39","documentation":"NewConfig calls loadConfigurationPaths, which expects the config_paths section to have been decoded into Config.ConfigPaths. This error means ConfigPaths is nil — no 'config_paths' section was present (or was explicitly empty) in the configuration file. Without it CrowdSec cannot resolve where configs, data, hub and notifications live, so startup aborts.","triggerScenarios":"Calling csconfig.NewConfig (or LoadConfigurationPaths) with a Config whose ConfigPaths field was never populated — typically the YAML file has no 'config_paths:' section, or the caller built a Config struct programmatically and left ConfigPaths nil.","commonSituations":"Hand-written minimal config.yaml missing the config_paths block; upgrading from a very old install whose config predates the config_paths section; test harnesses constructing Config{} directly without setting ConfigPaths.","solutions":["Add a 'config_paths:' section with at least config_dir and data_dir to the configuration file passed via -c","If constructing Config in code, initialize cfg.ConfigPaths = &ConfigurationPaths{ConfigDir: ..., DataDir: ...} before calling NewConfig","Copy a reference config (e.g. config/config.yaml in the repo or /etc/crowdsec/config.yaml) and adapt the paths"],"exampleFix":"// before (config.yaml)\napi:\n  server:\n    enabled: true\n\n// after (config.yaml)\nconfig_paths:\n  config_dir: /etc/crowdsec\n  data_dir: /var/lib/crowdsec/data\napi:\n  server:\n    enabled: true","handlingStrategy":"validation","validationCode":"if cfg.ConfigPaths == nil {\n    return fmt.Errorf(\"config file must contain a 'config_paths' section\")\n}","typeGuard":null,"tryCatchPattern":"if _, err := csconfig.NewConfig(configPath, false); err != nil {\n    if strings.Contains(err.Error(), \"no configuration paths\") {\n        log.Fatalf(\"config file %s is missing the config_paths section\", configPath)\n    }\n    return err\n}","preventionTips":["Start every config.yaml from the reference config in the repo, which includes config_paths","Keep config_dir and data_dir defined together in config_paths","Validate configs with `cscli config show` or a smoke run before deploying"],"tags":["config","crowdsec","startup"],"backgroundTag":"missing-required-config","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}