owasp-amass/amass · error
zero decoded assets
Error message
zero decoded assets
What it means
DecodeAssetsForScopeEndpoint decodes assets for a given scope and returns the decoded slice; when the scope contains no data (and any other decode path produced nothing), it returns this error instead of an empty result, signaling to API callers that no assets matched the requested scope.
Source
Thrown at engine/api/client/asset_decode.go:245
return nil, err
}
for _, a := range scope.Data {
results = append(results, &a)
}
case oam.URL:
var scope struct {
Data []oamurl.URL `json:"data"`
}
if err := json.NewDecoder(data).Decode(&scope); err != nil {
return nil, err
}
for _, a := range scope.Data {
results = append(results, &a)
}
}
if len(results) == 0 {
return nil, errors.New("zero decoded assets")
}
return results, nil
}
View on GitHub (pinned to 79299dce87)
Solutions
- Verify assets exist for the scope before decoding (list scopes/assets first).
- Broaden the scope filter so it matches ingested data.
- Ingest assets for the scope before requesting decoded output.
- Handle the error client-side by treating it as 'no data yet' if that is expected.
Example fix
// before
results, err := client.DecodeAssetsForScope(ctx, scopeID)
// after
assets, err := client.ListAssets(ctx, scopeID)
if len(assets) == 0 { return nil } // skip decode when scope is empty
results, err := client.DecodeAssetsForScope(ctx, scopeID) Defensive patterns
Strategy: try-catch
Validate before calling
scope, err := client.GetScope(ctx, scopeID)
if err != nil { return err }
if len(scope.Data) == 0 { return fmt.Errorf("scope %s has no assets to decode", scopeID) } Try / catch
results, err := endpoint.DecodeAssetsForScope(ctx, req)
if err != nil {
if strings.Contains(err.Error(), "zero decoded assets") {
// treat as empty result: log and return an empty slice
return []*Asset{}, nil
}
return err
} Prevention
- Check scope asset counts before decoding.
- Ingest data for scopes before requesting decoded assets.
- Differentiate 'empty' from 'failure' in API design.
- Monitor scopes with zero assets via metrics.
When it happens
Trigger: Calling the decode-assets endpoint/function with a scope whose Data slice is empty or nil — e.g. a scope filter that matches nothing, or querying before any assets were ingested for that scope.
Common situations: Querying a newly created scope with no ingested assets, over-restrictive scope filters, or stale scope identifiers after data cleanup.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- GLEIFSearchFuzzyCompletions: no results found
- not found
- bad request
- too many items in bulk request
- invalid asset type
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/c80ba619305bef93.
Report an issue: GitHub.