crowdsecurity/crowdsec · error
%s:%s has no download path
Error message
%s:%s has no download path
What it means
During hub index parsing (parseIndex, invoked by Hub.Load), every index entry must declare a RemotePath pointing to its upstream download location. If the entry exists but has an empty RemotePath, the hub cannot ever fetch it, so loading aborts. This protects against corrupt or hand-edited .index.json files.
Source
Thrown at pkg/cwhub/hub.go:90
bidx, err := os.ReadFile(h.local.HubIndexFile)
if err != nil {
return fmt.Errorf("unable to read index file: %w", err)
}
if err := json.Unmarshal(bidx, &h.items); err != nil {
return fmt.Errorf("failed to parse index: %w", err)
}
// Iterate over the different types to complete the struct
for _, itemType := range ItemTypes {
for name, item := range h.GetItemMap(itemType) {
if item == nil {
// likely defined as empty object or null in the index file
return fmt.Errorf("%s:%s has no index metadata", itemType, name)
}
if item.RemotePath == "" {
return fmt.Errorf("%s:%s has no download path", itemType, name)
}
if (itemType == PARSERS || itemType == POSTOVERFLOWS) && item.Stage == "" {
return fmt.Errorf("%s:%s has no stage", itemType, name)
}
item.hub = h
item.Name = name
item.Type = itemType
item.FileName = path.Base(item.RemotePath)
item.logMissingSubItems()
if item.latestHash() == "" {
h.logger.Errorf("invalid hub item %s: latest version missing from index", item.FQName())
}
}View on GitHub (pinned to 909b515798)
Solutions
- Re-run `cscli hub update` to regenerate a fresh index from the upstream hub
- Restore the .index.json file (delete it and let crowdsec re-download it)
- If authoring index entries, ensure each item sets RemotePath to its repo-relative path in the hub repository
- Check disk space / permissions if index writes were truncated
Example fix
// before (index entry)
"crowdsecurity/http-logs": {"name":"http-logs","remote_path":""}
// after
"crowdsecurity/http-logs": {"name":"http-logs","remote_path":"parsers/s01-bench/crowdsecurity/http-logs.yaml"} Defensive patterns
Strategy: validation
Validate before calling
if item == nil || item.RemotePath == "" {
return fmt.Errorf("skipping index entry %s:%s: missing remote path", itemType, name)
} Prevention
- Never hand-edit .index.json; use cscli hub update
- Back up the hub index before scripted modifications
- Validate index JSON against expected fields before loading
When it happens
Trigger: Calling Hub.Load() when the hub index file contains an entry for an item whose RemotePath field is empty, typically because the index was manually edited, truncated, or produced by a broken taint/update run.
Common situations: Hand-editing or regenerating the local .index.json; a failed `cscli hub update` leaving partial index entries; copying an index from another hub installation; syncing the hub directory with an incomplete file.
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
- invalid hub index: %w. Run 'sudo cscli hub update' to downlo
- no hub configuration provided
- unable to load appsec-config %s : %s
- appsec rule name is empty for %s
- invalid URL template '%s'
AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06).
Data as JSON: /api/errors/6af2f55070b1da63.
Report an issue: GitHub.