{"record":{"id":"42321627308e713f","repo":"owasp-amass/amass","slug":"error-unmarshalling-datasources-yaml-v","errorCode":null,"errorMessage":"error unmarshalling datasources YAML: %v","messagePattern":"error unmarshalling datasources YAML: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/datasrcs.go","lineNumber":113,"sourceCode":"\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 {\n\t\t// Ensure the TTL is not less than the global minimum\n\t\tif dsc.GlobalOptions != nil {\n\t\t\tif minTTL, ok := dsc.GlobalOptions[\"minimum_ttl\"]; ok && minTTL > ds.TTL {\n\t\t\t\tds.TTL = dsc.GlobalOptions[\"minimum_ttl\"]\n\t\t\t}\n\t\t} else {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/datasrcs.go#L95-L131","documentation":"The datasources YAML file was read successfully but yaml.Unmarshal failed to decode it into DataSourceConfig: the file contains syntactically or structurally invalid YAML (bad indentation, duplicate keys, or a shape that does not match the DataSourceConfig schema). The yaml error is wrapped with %v, so details of the offending line are in the underlying error.","triggerScenarios":"Thrown at config/datasrcs.go:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the datasources YAML with a linter or 'yaml.Unmarshal' in a scratch program to find the exact parse error","Compare the file's structure against the DataSourceConfig schema and fix field names/nesting","Use %w wrapping so the yaml.TypeError with line numbers propagates to the user"],"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"}