{"record":{"id":"b380e6f2f19a3aac","repo":"owasp-amass/amass","slug":"config-options-are-not-initialized","errorCode":null,"errorMessage":"config options are not initialized","messagePattern":"config options are not initialized","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/engineapi.go","lineNumber":43,"sourceCode":"\tOptions  string // Extra options used while connecting to the Engine API\n}\n\nconst (\n\tengineUser   = \"AMASS_ENGINE_USER\"\n\tenginePass   = \"AMASS_ENGINE_PASSWORD\"\n\tengineHost   = \"AMASS_ENGINE_HOST\"\n\tenginePort   = \"AMASS_ENGINE_PORT\"\n\tenginePath   = \"AMASS_ENGINE_PATH\"\n\tengineScheme = \"AMASS_ENGINE_SCHEME\"\n)\n\n// loadEngineSettings is responsible for extracting the \"engine\" URL from the application's configuration\n// and initializing the EngAPI structure. It performs several checks such as ensuring the configuration options\n// are initialized and the \"engine\" key is present and of type string. If any of these checks fail, an error is returned.\nfunc (c *Config) loadEngineSettings(cfg *Config) error {\n\t// Check if configuration options are initialized; if not, return an error.\n\tif c.Options == nil {\n\t\treturn fmt.Errorf(\"config options are not initialized\")\n\t}\n\t// Attempt to retrieve the \"engine\" value from the configuration options.\n\tapiURIInterface, ok := c.Options[\"engine\"]\n\tif !ok {\n\t\treturn c.LoadEngineEnvSettings()\n\t}\n\t// Assert that the \"engine\" option is of type string; if not, return an error specifying the incorrect type received.\n\tapiURI, ok := apiURIInterface.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"expected 'engine' to be a string, got %T\", apiURIInterface)\n\t}\n\t// Load the Engine API URI information into the EngAPI structure.\n\t// If there's an error during this process, it's returned to the calling function.\n\tif err := c.loadEngineURI(apiURI); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/engineapi.go#L25-L61","documentation":"loadEngineSettings found c.Options nil: the configuration's option map was never populated before attempting to read the 'engine' key. This is a precondition guard — it fires when configuration loading/initialization was skipped or failed earlier, not because of anything wrong with the engine setting itself.","triggerScenarios":"Thrown at config/engineapi.go:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the Config was fully initialized (options loaded from file/CLI/env) before loadEngineSettings runs","Check the earlier configuration loading step for a swallowed error that left Options nil","Fail fast at startup with a clear 'configuration not loaded' error instead of relying on this guard"],"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"}