{"record":{"id":"14db5ceab098e3dc","repo":"owasp-amass/amass","slug":"invalid-type-for-ttl-in-default-transform-values","errorCode":null,"errorMessage":"invalid type for ttl in default_transform_values","messagePattern":"invalid type for ttl in default_transform_values","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/transform.go","lineNumber":83,"sourceCode":"\t\t}\n\t}\n\t// If the loop completes with no conflicts, the function returns nil, indicating success.\n\treturn nil\n}\n\nfunc (c *Config) loadGlobalTransformSettings() error {\n\t// get the default_transfom_values in the config yaml\n\tif dtv, ok := c.Options[\"default_transform_values\"]; ok {\n\t\t// Assert the type to map[interface{}]interface{}\n\t\tdtvMap, ok := dtv.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"invalid type for default_transform_values\")\n\t\t}\n\t\t// Convert the map to the Transformation struct\n\t\tif ttl, ok := dtvMap[\"ttl\"].(int); ok {\n\t\t\tc.DefaultTransformations.TTL = ttl\n\t\t} else if !ok && dtvMap[\"ttl\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for ttl in default_transform_values\")\n\t\t}\n\t\tif confidence, ok := dtvMap[\"confidence\"].(int); ok {\n\t\t\tc.DefaultTransformations.Confidence = confidence\n\t\t} else if !ok && dtvMap[\"confidence\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for confidence in default_transform_values\")\n\t\t}\n\t\tif priority, ok := dtvMap[\"priority\"].(int); ok {\n\t\t\tc.DefaultTransformations.Priority = priority\n\t\t} else if !ok && dtvMap[\"priority\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for priority in default_transform_values\")\n\t\t}\n\n\t}\n\treturn nil\n}\n\n// Split splits the key into 'From' and 'To' components, expecting a \"->\" delimiter.\n// Requires a non-nil Transformation pointer and a valid key format. Example: FQDN->IPaddress.","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/transform.go#L65-L101","documentation":"Within default_transform_values, the 'ttl' key must be an integer; if it exists with another type this error is returned. It means the configured TTL value has an invalid type (string, float, bool, etc.).","triggerScenarios":"YAML like 'default_transform_values:\\n  ttl: \"60\"' or 'ttl: 60.5' — a quoted number or float that fails the .(int) type assertion while being non-nil.","commonSituations":"Quoting numeric values in YAML (making them strings), using a duration string like '60s', or floats from a generated config.","solutions":["Remove quotes so the TTL is a YAML integer: ttl: 60","Use a whole number of seconds instead of a duration string","Verify with a YAML linter that ttl parses as an int"],"exampleFix":"// before\ndefault_transform_values:\n  ttl: \"60\"\n// after\ndefault_transform_values:\n  ttl: 60","handlingStrategy":"type-guard","validationCode":"if v, ok := dtv[\"ttl\"]; ok && v != nil {\n\tif _, isInt := v.(int); !isInt {\n\t\treturn errors.New(\"ttl in default_transform_values must be an integer\")\n\t}\n}","typeGuard":"func isInt(v interface{}) bool { _, ok := v.(int); return ok }","tryCatchPattern":"if err := cfg.LoadSettings(path); err != nil && strings.Contains(err.Error(), \"invalid type for ttl\") {\n\treturn fmt.Errorf(\"ttl must be an unquoted integer in %s\", path)\n}","preventionTips":["Write ttl as an unquoted YAML integer","Never use duration strings like '60s'","Run YAML through a linter to confirm scalar types"],"tags":["config","yaml","type-error","ttl","amass"],"backgroundTag":"config-type-mismatch","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"}