{"record":{"id":"fa95ea6f265cb964","repo":"owasp-amass/amass","slug":"missing-scheme-in-database-uri","errorCode":null,"errorMessage":"missing scheme in database URI","messagePattern":"missing scheme in database URI","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/engineapi.go","lineNumber":119,"sourceCode":"\tapiURI = scheme + \"://\" + u + p + h + \":\" + port\n\teng.URL = apiURI\n\n\tc.EngineAPI = eng\n\treturn nil\n}\n\n// loadEngineURI takes the Engine API's URI as a string, parses it, and populates the EngAPI structure with the URI's components.\n// It performs validations to ensure the URI contains a valid scheme and hostname. If parsing fails or any validation check doesn't pass,\n// an error is returned. It also handles extracting authentication information and any additional options provided in the URI query.\nfunc (c *Config) loadEngineURI(apiURI string) error {\n\t// Parse the raw URI string to a url.URL object. If the URI is malformed, an error is returned.\n\tu, err := url.Parse(apiURI)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Check for valid scheme\n\tif u.Scheme == \"\" {\n\t\treturn fmt.Errorf(\"missing scheme in database URI\")\n\t}\n\t// Check for reachable hostname\n\tif u.Hostname() == \"\" {\n\t\treturn fmt.Errorf(\"missing hostname in database URI\")\n\t}\n\t// If the path is present in the URI and is more than just a \"/\", it's trimmed and used.\n\t// If the path is empty or just a \"/\", it defaults to an empty string.\n\tapiURIPath := \"\"\n\t// Only get the api file path name if it's not empty or a single slash\n\tif u.Path != \"\" && u.Path != \"/\" {\n\t\tapiURIPath = strings.TrimPrefix(u.Path, \"/\")\n\t}\n\t// Initialize a new EngAPI object with data from the parsed URI.\n\tapi := &EngAPI{\n\t\tURL:      apiURI,\n\t\tScheme:   u.Scheme,\n\t\tUsername: u.User.Username(),\n\t\tPath:     apiURIPath,","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/engineapi.go#L101-L137","documentation":"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.","triggerScenarios":"Thrown at config/engineapi.go:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prefix the engine URI with an explicit scheme, e.g. \"grpc://localhost:2301\" or \"http://...\"","When using AMASS_ENGINE_HOST/PORT env vars, also set AMASS_ENGINE_SCHEME so a scheme can be composed","Validate the URI with url.Parse and check u.Scheme before passing it into engine configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}