owasp-amass/amass · error

missing scheme in database URI

Error message

missing scheme in database URI

What it means

loadEngineURI parsed the engine API URI successfully but its scheme component is empty (e.g. "host:port" with no scheme:// prefix). The scheme is required to pick the transport and build the final API URL, so the URI is rejected. Reached from loadEngineSettings and from env-based settings when AMASS_ENGINE_* variables are incomplete.

Source

Thrown at config/engineapi.go:119

	apiURI = scheme + "://" + u + p + h + ":" + port
	eng.URL = apiURI

	c.EngineAPI = eng
	return nil
}

// loadEngineURI takes the Engine API's URI as a string, parses it, and populates the EngAPI structure with the URI's components.
// It performs validations to ensure the URI contains a valid scheme and hostname. If parsing fails or any validation check doesn't pass,
// an error is returned. It also handles extracting authentication information and any additional options provided in the URI query.
func (c *Config) loadEngineURI(apiURI string) error {
	// Parse the raw URI string to a url.URL object. If the URI is malformed, an error is returned.
	u, err := url.Parse(apiURI)
	if err != nil {
		return err
	}
	// Check for valid scheme
	if u.Scheme == "" {
		return fmt.Errorf("missing scheme in database URI")
	}
	// Check for reachable hostname
	if u.Hostname() == "" {
		return fmt.Errorf("missing hostname in database URI")
	}
	// If the path is present in the URI and is more than just a "/", it's trimmed and used.
	// If the path is empty or just a "/", it defaults to an empty string.
	apiURIPath := ""
	// Only get the api file path name if it's not empty or a single slash
	if u.Path != "" && u.Path != "/" {
		apiURIPath = strings.TrimPrefix(u.Path, "/")
	}
	// Initialize a new EngAPI object with data from the parsed URI.
	api := &EngAPI{
		URL:      apiURI,
		Scheme:   u.Scheme,
		Username: u.User.Username(),
		Path:     apiURIPath,

View on GitHub (pinned to 79299dce87)

Solutions

  1. Prefix the engine URI with an explicit scheme, e.g. "grpc://localhost:2301" or "http://..."
  2. When using AMASS_ENGINE_HOST/PORT env vars, also set AMASS_ENGINE_SCHEME so a scheme can be composed
  3. Validate the URI with url.Parse and check u.Scheme before passing it into engine configuration
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at config/engineapi.go:119 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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