owasp-amass/amass · error

invalid config: valid transformation specified after 'none'

Error message

invalid config: valid transformation specified after 'none' for 'From' type: %s. 'None' should be the only transformation

What it means

Mirror image of the 'none after valid' error: a real (non-none) transformation is declared for a 'From' type that already registered a 'none' transformation. Because 'none' terminates processing for that From type, any subsequent valid transformation is unreachable and contradictory, so Validate rejects the config.

Source

Thrown at config/transform.go:160

		if tfound && ffound {
			break
		}
	}

	if !ffound {
		return fmt.Errorf("invalid 'From' type: %s does not comply with OAM", t.From)
	}
	// Check for a 'none' transformation, which indicates that no further processing is required for this 'From' type.
	if t.To == "none" {
		// Conflict arises if there's already a valid transformation for this 'From'.
		if c.fromWithValid[t.From] {
			return fmt.Errorf("invalid config: 'none' specified after a valid transformation for 'From' type: %s. 'None' should be the only transformation", t.From)
		}
		c.fromWithNone[t.From] = true
	} else { // For other valid transformations.
		// Conflict arises if a 'none' transformation is already registered for this 'From'.
		if c.fromWithNone[t.From] {
			return fmt.Errorf("invalid config: valid transformation specified after 'none' for 'From' type: %s. 'None' should be the only transformation", t.From)
		}
		// Mark this 'From' as having a valid transformation.
		c.fromWithValid[t.From] = true
	}

	return nil
}

// CheckTransformations checks if the given 'From' type has a valid transformation to any of the given 'To' types.
func (c *Config) CheckTransformations(from string, tos ...string) (*Matches, error) {
	lower := strings.ToLower(from)
	tomap := make(map[string]struct{})
	results := &Matches{to: make(map[string]struct {
		ttl        int
		confidence int
	})}

	for _, v := range tos {

View on GitHub (pinned to 79299dce87)

Solutions

  1. Delete the 'none' entry for that From type so the valid transformation applies
  2. Or delete the valid entry if 'none' was intentional
  3. Ensure only one transformation exists per From type

Example fix

// before
transformations:
  - from: workloadType
    to: none
  - from: workloadType
    to: deployment
// after
transformations:
  - from: workloadType
    to: deployment
Defensive patterns

Strategy: validation

Validate before calling

noneFrom := map[string]bool{}
for _, t := range transformations { if t.To == "none" { noneFrom[t.From] = true } }
for _, t := range transformations { if t.To != "none" && noneFrom[t.From] { return errors.New("valid transform conflicts with 'none' for " + t.From) } }

Try / catch

if err := cfg.Validate(); err != nil {
  if strings.Contains(err.Error(), "valid transformation specified after 'none'") {
    // remove the 'none' entry or the valid entry, then re-validate
  }
  return err
}

Prevention

When it happens

Trigger: Config.Validate sees a transformation with a real To target whose From type is already present in c.fromWithNone.

Common situations: Appending new transformation rules after a catch-all 'none' rule, or copy-pasting transformation blocks where a 'none' placeholder was left in place.

Related errors


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