{"record":{"id":"95d23fbee97c8215","repo":"owasp-amass/amass","slug":"failed-to-get-absolute-path-v","errorCode":null,"errorMessage":"failed to get absolute path: %v","messagePattern":"failed to get absolute path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/datasrcs.go","lineNumber":102,"sourceCode":"\treturn nil\n}\n\nfunc (c *Config) loadDataSourceSettings(cfg *Config) error {\n\t// Retrieve the datasources file path from the options\n\tpathInterface, ok := c.Options[\"datasources\"]\n\tif !ok {\n\t\t// \"datasources\" not found in options, so nothing to do here.\n\t\treturn nil\n\t}\n\n\tpath, ok := pathInterface.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"datasources option is not a string\")\n\t}\n\t// Construct the absolute path by joining the current working directory and the relative path\n\tabsPath, err := c.AbsPathFromConfigDir(path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get absolute path: %v\", err)\n\t}\n\t// Load the datasources YAML file\n\tdata, err := os.ReadFile(absPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error reading datasources file: %v\", err)\n\t}\n\t// Unmarshal the YAML data into a DataSourceConfig\n\tvar dsConfig DataSourceConfig\n\terr = yaml.Unmarshal(data, &dsConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error unmarshalling datasources YAML: %v\", err)\n\t}\n\n\tdsConfig.MapNames()\n\t// Assign the unmarshalled DataSourceConfig to the Config struct\n\tc.DataSrcConfigs = &dsConfig\n\tc.DataSrcConfigs.ttlCheck()\n\treturn nil","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/datasrcs.go#L84-L120","documentation":"loadDataSourceSettings could not turn the configured 'datasources' file path into an absolute path: AbsPathFromConfigDir returned an error (unresolvable working/config directory or malformed path). The raw error is wrapped with %v, losing errors.Is unwrap-ability. File I/O has not been attempted yet at this point.","triggerScenarios":"Thrown at config/datasrcs.go:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the 'datasources' option value in the config YAML/CLI for typos or invalid characters","Ensure the configuration directory (and current working directory it is resolved against) exists and is readable","Use %w instead of %v when wrapping so callers can inspect the underlying path error"],"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-14T05:17:10.506Z"}