owasp-amass/amass · error

invalid type for ttl in default_transform_values

Error message

invalid type for ttl in default_transform_values

What it means

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.).

Source

Thrown at config/transform.go:83

		}
	}
	// If the loop completes with no conflicts, the function returns nil, indicating success.
	return nil
}

func (c *Config) loadGlobalTransformSettings() error {
	// get the default_transfom_values in the config yaml
	if dtv, ok := c.Options["default_transform_values"]; ok {
		// Assert the type to map[interface{}]interface{}
		dtvMap, ok := dtv.(map[string]interface{})
		if !ok {
			return fmt.Errorf("invalid type for default_transform_values")
		}
		// Convert the map to the Transformation struct
		if ttl, ok := dtvMap["ttl"].(int); ok {
			c.DefaultTransformations.TTL = ttl
		} else if !ok && dtvMap["ttl"] != nil {
			return fmt.Errorf("invalid type for ttl in default_transform_values")
		}
		if confidence, ok := dtvMap["confidence"].(int); ok {
			c.DefaultTransformations.Confidence = confidence
		} else if !ok && dtvMap["confidence"] != nil {
			return fmt.Errorf("invalid type for confidence in default_transform_values")
		}
		if priority, ok := dtvMap["priority"].(int); ok {
			c.DefaultTransformations.Priority = priority
		} else if !ok && dtvMap["priority"] != nil {
			return fmt.Errorf("invalid type for priority in default_transform_values")
		}

	}
	return nil
}

// Split splits the key into 'From' and 'To' components, expecting a "->" delimiter.
// Requires a non-nil Transformation pointer and a valid key format. Example: FQDN->IPaddress.

View on GitHub (pinned to 79299dce87)

Solutions

  1. Remove quotes so the TTL is a YAML integer: ttl: 60
  2. Use a whole number of seconds instead of a duration string
  3. Verify with a YAML linter that ttl parses as an int

Example fix

// before
default_transform_values:
  ttl: "60"
// after
default_transform_values:
  ttl: 60
Defensive patterns

Strategy: type-guard

Validate before calling

if v, ok := dtv["ttl"]; ok && v != nil {
	if _, isInt := v.(int); !isInt {
		return errors.New("ttl in default_transform_values must be an integer")
	}
}

Type guard

func isInt(v interface{}) bool { _, ok := v.(int); return ok }

Try / catch

if err := cfg.LoadSettings(path); err != nil && strings.Contains(err.Error(), "invalid type for ttl") {
	return fmt.Errorf("ttl must be an unquoted integer in %s", path)
}

Prevention

When it happens

Trigger: 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.

Common situations: Quoting numeric values in YAML (making them strings), using a duration string like '60s', or floats from a generated config.

Related errors


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/14db5ceab098e3dc. Report an issue: GitHub.