crowdsecurity/crowdsec · error
nameless bucket
Error message
nameless bucket
What it means
loadBucketFactoriesFromFile logs 'Won't load nameless bucket' and returns this error when a parsed bucket file has an empty Spec.Name. Unlike Validate, this is raised during bulk loading of the hub directory, aborting the load of that file.
Source
Thrown at pkg/leakybucket/manager_load.go:145
f := BucketFactory{}
err = dec.Decode(&f.Spec)
if err != nil {
if !errors.Is(err, io.EOF) {
log.Errorf("Bad yaml in %s: %v", itemPath, err)
return nil, fmt.Errorf("bad yaml in %s: %w", itemPath, err)
}
log.Tracef("End of yaml file")
break
}
f.DataDir = hub.GetDataDir()
// check empty
if f.Spec.Name == "" {
log.Errorf("Won't load nameless bucket")
return nil, errors.New("nameless bucket")
}
// check compat
if f.Spec.FormatVersion == "" {
log.Tracef("no version in %s : %s, assuming '1.0'", f.Spec.Name, itemPath)
f.Spec.FormatVersion = "1.0"
}
ok, err := constraint.Satisfies(f.Spec.FormatVersion, constraint.Scenario)
if err != nil {
return nil, fmt.Errorf("failed to check version: %w", err)
}
if !ok {
log.Errorf("can't load %s : %s doesn't satisfy scenario format %s, skip", f.Spec.Name, f.Spec.FormatVersion, constraint.Scenario)
continue
}
f.Filename = filepath.Clean(itemPath)View on GitHub (pinned to 909b515798)
Solutions
- Inspect the offending scenario file reported in logs and add the `name:` field
- Re-sync the hub (`cscli hub update` + `cscli hub upgrade`) to restore pristine files
- Remove or fix the broken local override file
Example fix
# before (broken file) type: leaky filter: "..." # after type: leaky name: author/scenario-name filter: "..."
Defensive patterns
Strategy: validation
Validate before calling
for _, f := range scenarioFiles {
if parseBucket(f).Spec.Name == "" {
log.Printf("file %s has no name; fix before reload", f)
}
} Prevention
- Version-control /etc/crowdsec/scenarios to spot corrupted edits
- Re-run `cscli hub update && cscli hub upgrade` after bad syncs
- Tail crowdsec logs on startup for 'nameless bucket' warnings
When it happens
Trigger: Parsing a bucket file from disk whose name field is empty, via LoadBuckets.
Common situations: A corrupted or hand-edited scenario file in /etc/crowdsec/scenarios, a bad hub sync that wrote partial YAML, or a mounted config missing the name key.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- bucket must have name
- description is mandatory
- leakspeed is required
- duration is required
- a condition is required
AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06).
Data as JSON: /api/errors/53527d19c2cd9e12.
Report an issue: GitHub.