{"record":{"id":"a005030db867b8bd","repo":"owasp-amass/amass","slug":"error-reading-datasources-file-v","errorCode":null,"errorMessage":"error reading datasources file: %v","messagePattern":"error reading datasources file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/datasrcs.go","lineNumber":107,"sourceCode":"\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\n}\n\nfunc (dsc *DataSourceConfig) ttlCheck() {\n\t// The global minimum TTL is already loaded during the YAML unmarshalling process\n\tfor _, ds := range dsc.Datasources {","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/datasrcs.go#L89-L125","documentation":"loadDataSourceSettings resolved the datasources YAML file to an absolute path but os.ReadFile failed on it — typically the file does not exist, is a directory, or lacks read permission. The os error is wrapped with %v; the message names the file-reading step specifically, distinguishing it from path resolution and unmarshalling failures.","triggerScenarios":"Thrown at config/datasrcs.go:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the datasources file exists at the resolved absolute path and is a regular file","Fix permissions (readable by the running user) if access is denied","Point the 'datasources' option at the correct path or create the file if it was never generated"],"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"}