{"record":{"id":"1361586f47a21bfc","repo":"crowdsecurity/crowdsec","slug":"no-acquisition-path-or-acquisition-dir-specified","errorCode":null,"errorMessage":"no acquisition_path or acquisition_dir specified","messagePattern":"no acquisition_path or acquisition_dir specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/csconfig/crowdsec_service.go","lineNumber":43,"sourceCode":"\tOutputRoutinesCount       int              `yaml:\"output_routines\"`\n\tSimulationConfig          SimulationConfig `yaml:\"-\"`\n\tBucketStateFile           string           `yaml:\"state_input_file,omitempty\"` // if we need to unserialize buckets at start\n\tBucketStateDumpDir        string           `yaml:\"state_output_dir,omitempty\"` // if we need to unserialize buckets on shutdown\n\tBucketsGCEnabled          bool             `yaml:\"-\"`                          // we need to garbage collect buckets when in forensic mode\n\tDNSCache                  *DNSCacheCfg     `yaml:\"dns_cache,omitempty\"`\n\n\tSimulationFilePath string              `yaml:\"-\"`\n\tContextToSend      map[string][]string `yaml:\"-\"`\n}\n\n// Cache config for DNS lookups (legit bots, rdns PO)\ntype DNSCacheCfg struct {\n\tTTL         *time.Duration `yaml:\"ttl,omitempty\"`\n\tNegativeTTL *time.Duration `yaml:\"negative_ttl,omitempty\"`\n\tSize        *int           `yaml:\"size,omitempty\"`\n}\n\nvar ErrNoAcquisitionDefined = errors.New(\"no acquisition_path or acquisition_dir specified\")\n\nfunc (c *CrowdsecServiceCfg) CollectAcquisitionFiles() ([]string, error) {\n\tret := []string{}\n\n\t// agent section missing in the configuration file.\n\t// likely a lapi-only setup, not much we can do here\n\tif c == nil {\n\t\treturn nil, nil\n\t}\n\n\tif c.AcquisitionFilePath != \"\" {\n\t\tlog.Debugf(\"non-empty acquisition_path %s\", c.AcquisitionFilePath)\n\n\t\t_, err := os.Stat(c.AcquisitionFilePath)\n\n\t\tswitch {\n\t\tcase errors.Is(err, fs.ErrNotExist):\n\t\t\tlog.Debugf(\"acquisition_path: %s does not exist, skipping\", c.AcquisitionFilePath)","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/csconfig/crowdsec_service.go#L25-L61","documentation":"ErrNoAcquisitionDefined is the sentinel returned when a CrowdsecServiceCfg has neither acquisition_path nor acquisition_dir configured. CollectAcquisitionFiles and LoadCrowdsec use it to distinguish 'agent has nothing to read' from real errors; LoadCrowdsec treats it as a warning (empty acquisition list) rather than a hard failure.","triggerScenarios":"config.yaml with no 'acquisition_path:'/'acquisition_dir:' keys in the crowdsec agent section; running crowdsec in LAPI-only mode; calling LoadCrowdsec on a Config parsed from a server-only config.","commonSituations":"LAPI-only setups (expected, logged as warning); users converting an agent to LAPI and leaving no acquisition section; typos like acquire_dir or acquisiton_path so neither key is recognized.","solutions":["Add 'acquisition_dir: /etc/crowdsec/acquis.d' (or acquisition_path pointing at acquis.yaml) under the crowdsec config section","Check key spelling — only acquisition_path and acquisition_dir are recognized","If intentionally LAPI-only, ignore the warning; it is not fatal when handled through LoadCrowdsec"],"exampleFix":"// before (crowdsec section)\ncrowdsec:\n  service: true\n\n// after\ncrowdsec:\n  service: true\n  acquisition_path: /etc/crowdsec/acquis.yaml","handlingStrategy":"try-catch","validationCode":"if cfg.Crowdsec != nil && cfg.Crowdsec.AcquisitionDirPath == \"\" && cfg.Crowdsec.AcquisitionFilePath == \"\" {\n    log.Warn(\"no acquisition configured; agent will collect nothing\")\n}","typeGuard":null,"tryCatchPattern":"files, err := cfg.Crowdsec.CollectAcquisitionFiles()\nif err != nil {\n    if errors.Is(err, csconfig.ErrNoAcquisitionDefined) {\n        log.Warning(\"LAPI-only setup, skipping acquisition\")\n        return nil\n    }\n    return err\n}","preventionTips":["Use errors.Is against the exported ErrNoAcquisitionDefined sentinel instead of string matching","For LAPI-only hosts, document that the warning is expected","Double-check acquisition_path/acquisition_dir spelling in configs"],"tags":["config","acquisition","crowdsec"],"backgroundTag":"missing-config-value","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"}