{"record":{"id":"452e8ac5ecb42e93","repo":"owasp-amass/amass","slug":"invalid-config-valid-transformation-specified-aft","errorCode":null,"errorMessage":"invalid config: valid transformation specified after 'none' for 'From' type: %s. 'None' should be the only transformation","messagePattern":"invalid config: valid transformation specified after 'none' for 'From' type: (.+?)\\. 'None' should be the only transformation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/transform.go","lineNumber":160,"sourceCode":"\t\tif tfound && ffound {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !ffound {\n\t\treturn fmt.Errorf(\"invalid 'From' type: %s does not comply with OAM\", t.From)\n\t}\n\t// Check for a 'none' transformation, which indicates that no further processing is required for this 'From' type.\n\tif t.To == \"none\" {\n\t\t// Conflict arises if there's already a valid transformation for this 'From'.\n\t\tif c.fromWithValid[t.From] {\n\t\t\treturn fmt.Errorf(\"invalid config: 'none' specified after a valid transformation for 'From' type: %s. 'None' should be the only transformation\", t.From)\n\t\t}\n\t\tc.fromWithNone[t.From] = true\n\t} else { // For other valid transformations.\n\t\t// Conflict arises if a 'none' transformation is already registered for this 'From'.\n\t\tif c.fromWithNone[t.From] {\n\t\t\treturn fmt.Errorf(\"invalid config: valid transformation specified after 'none' for 'From' type: %s. 'None' should be the only transformation\", t.From)\n\t\t}\n\t\t// Mark this 'From' as having a valid transformation.\n\t\tc.fromWithValid[t.From] = true\n\t}\n\n\treturn nil\n}\n\n// CheckTransformations checks if the given 'From' type has a valid transformation to any of the given 'To' types.\nfunc (c *Config) CheckTransformations(from string, tos ...string) (*Matches, error) {\n\tlower := strings.ToLower(from)\n\ttomap := make(map[string]struct{})\n\tresults := &Matches{to: make(map[string]struct {\n\t\tttl        int\n\t\tconfidence int\n\t})}\n\n\tfor _, v := range tos {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/transform.go#L142-L178","documentation":"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.","triggerScenarios":"Config.Validate sees a transformation with a real To target whose From type is already present in c.fromWithNone.","commonSituations":"Appending new transformation rules after a catch-all 'none' rule, or copy-pasting transformation blocks where a 'none' placeholder was left in place.","solutions":["Delete the 'none' entry for that From type so the valid transformation applies","Or delete the valid entry if 'none' was intentional","Ensure only one transformation exists per From type"],"exampleFix":"// before\ntransformations:\n  - from: workloadType\n    to: none\n  - from: workloadType\n    to: deployment\n// after\ntransformations:\n  - from: workloadType\n    to: deployment","handlingStrategy":"validation","validationCode":"noneFrom := map[string]bool{}\nfor _, t := range transformations { if t.To == \"none\" { noneFrom[t.From] = true } }\nfor _, t := range transformations { if t.To != \"none\" && noneFrom[t.From] { return errors.New(\"valid transform conflicts with 'none' for \" + t.From) } }","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n  if strings.Contains(err.Error(), \"valid transformation specified after 'none'\") {\n    // remove the 'none' entry or the valid entry, then re-validate\n  }\n  return err\n}","preventionTips":["Treat 'none' as terminal: never add other transforms for the same From","Review hand-edited transformation blocks for leftover 'none' placeholders","Add a lint rule enforcing one transformation per From type"],"tags":["config","validation","conflict"],"backgroundTag":"conflicting-config-options","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}