owasp-amass/amass · error

invalid config: 'none' specified after a valid transformatio

Error message

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

What it means

This error is thrown when the same 'From' type has both a valid transformation and a 'none' transformation, with 'none' appearing after the valid one. Since 'none' means no further processing, mixing it with real transformations for the same From type is contradictory, so Validate rejects it. The 'none' entry must be the only transformation for that From type.

Source

Thrown at config/transform.go:154

			ffound = true
		}
		if t.To == a || t.To == "none" || t.To == "all" {
			tfound = true
		}
		// Used to prevent unnecessary iterations
		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{})

View on GitHub (pinned to 79299dce87)

Solutions

  1. Remove the 'none' entry for that From type, or remove the conflicting valid transformation
  2. Keep exactly one transformation per From type
  3. Merge configs programmatically, deduplicating by From key

Example fix

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

Strategy: validation

Validate before calling

seenNone := map[string]bool{}; seenValid := map[string]bool{}
for _, t := range transformations {
  if (t.To == "none" && seenValid[t.From]) || (t.To != "none" && seenNone[t.From]) { return errors.New("conflicting transformations for " + t.From) }
  if t.To == "none" { seenNone[t.From] = true } else { seenValid[t.From] = true }
}

Try / catch

if err := cfg.Validate(); err != nil {
  if strings.Contains(err.Error(), "'none' should be the only transformation") {
    // dedupe transformations by From type and re-validate
  }
  return err
}

Prevention

When it happens

Trigger: Config.Validate encounters a transformation with To == "none" whose From type is already registered in c.fromWithValid (a prior entry had a real target).

Common situations: Merging transformation lists from multiple sources, appending overrides to a base config without removing the original entry.

Related errors


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