owasp-amass/amass · warning

GLEIFSearchFuzzyCompletions: no results found

Error message

GLEIFSearchFuzzyCompletions: no results found

What it means

After successfully decoding the GLEIF response, GLEIFSearchFuzzyCompletions checks that at least one LEI record was returned. If result.Data is empty, it returns this sentinel-style error indicating the GLEIF API had no fuzzy matches for the queried name. This is an expected, non-fatal outcome for many inputs.

Source

Thrown at engine/plugins/api/gleif/gleif.go:49

func GLEIFSearchFuzzyCompletions(ctx context.Context, name string) (*FuzzyCompletionsResponse, error) {
	u := "https://api.gleif.org/api/v1/fuzzycompletions?field=entity.legalName&q=" + url.QueryEscape(name)

	_ = gleifLimit.Wait(ctx)
	wctx, cancel := context.WithTimeout(ctx, 60*time.Second)
	defer cancel()

	resp, err := amasshttp.RequestWebPage(wctx, amasshttp.DefaultClient, &amasshttp.Request{URL: u})
	if err != nil || resp.Body == "" {
		msg := fmt.Sprintf("Failed to obtain the LEI record for %s: %s", name, err)
		return nil, fmt.Errorf("GLEIFSearchFuzzyCompletions: %s", msg)
	}

	var result FuzzyCompletionsResponse
	if err := json.Unmarshal([]byte(resp.Body), &result); err != nil {
		msg := fmt.Sprintf("Failed to unmarshal the LEI record for %s: %s", name, err)
		return nil, fmt.Errorf("GLEIFSearchFuzzyCompletions: %s", msg)
	} else if len(result.Data) == 0 {
		return nil, fmt.Errorf("GLEIFSearchFuzzyCompletions: no results found")
	}

	return &result, nil
}

// GLEIFGetLEIRecord retrieves the LEI record for the given identifier.
func GLEIFGetLEIRecord(ctx context.Context, id string) (*LEIRecord, error) {
	u := "https://api.gleif.org/api/v1/lei-records/" + id

	_ = gleifLimit.Wait(ctx)
	wctx, cancel := context.WithTimeout(ctx, 60*time.Second)
	defer cancel()

	resp, err := amasshttp.RequestWebPage(wctx,
		amasshttp.DefaultClient, &amasshttp.Request{URL: u})
	if err != nil || resp.StatusCode != 200 || resp.Body == "" {
		return nil, err
	}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Confirm the queried name is an actual legal entity name registered with GLEIF; try the exact legal name.
  2. Shorten the query to the core organization name to widen fuzzy matching.
  3. Treat this as an expected empty result in the caller and skip this data source rather than failing the scan.
  4. Try the exact-match GLEIF search endpoint or search by LEI identifier if known.
  5. Check the query URL parameters (page size, filters) are not accidentally over-restricting results.

Example fix

// before
} else if len(result.Data) == 0 {
	return nil, fmt.Errorf("GLEIFSearchFuzzyCompletions: no results found")
}
// after
} else if len(result.Data) == 0 {
	return nil, nil // or a typed sentinel: ErrNoGLEIFResults, so callers can errors.Is and skip gracefully
}
Defensive patterns

Strategy: fallback

Try / catch

result, err := GLEIFSearchFuzzyCompletions(ctx, name)
if err != nil && strings.HasSuffix(err.Error(), "no results found") {
	// expected: continue with other data sources
	return nil
}

Prevention

When it happens

Trigger: A valid HTTP 200 response with a well-formed FuzzyCompletionsResponse whose Data array has length 0 — i.e., GLEIF found no organizations matching the submitted name.

Common situations: Querying GLEIF for a name that is not a registered legal entity (person names, product names, subdomains); misspelled or highly localized company names; querying with overly specific strings instead of the legal name.

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


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/9d7a906f1bfbec2c. Report an issue: GitHub.