{"record":{"id":"9f93aac07ede2475","repo":"owasp-amass/amass","slug":"invalid-config-none-specified-after-a-valid-tra","errorCode":null,"errorMessage":"invalid config: 'none' specified after a valid transformation for 'From' type: %s. 'None' should be the only transformation","messagePattern":"invalid config: 'none' specified after a valid transformation for 'From' type: (.+?)\\. 'None' should be the only transformation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/transform.go","lineNumber":154,"sourceCode":"\t\t\tffound = true\n\t\t}\n\t\tif t.To == a || t.To == \"none\" || t.To == \"all\" {\n\t\t\ttfound = true\n\t\t}\n\t\t// Used to prevent unnecessary iterations\n\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{})","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/transform.go#L136-L172","documentation":"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.","triggerScenarios":"Config.Validate encounters a transformation with To == \"none\" whose From type is already registered in c.fromWithValid (a prior entry had a real target).","commonSituations":"Merging transformation lists from multiple sources, appending overrides to a base config without removing the original entry.","solutions":["Remove the 'none' entry for that From type, or remove the conflicting valid transformation","Keep exactly one transformation per From type","Merge configs programmatically, deduplicating by From key"],"exampleFix":"// before\ntransformations:\n  - from: workloadType\n    to: deployment\n  - from: workloadType\n    to: none\n// after\ntransformations:\n  - from: workloadType\n    to: deployment","handlingStrategy":"validation","validationCode":"seenNone := map[string]bool{}; seenValid := map[string]bool{}\nfor _, t := range transformations {\n  if (t.To == \"none\" && seenValid[t.From]) || (t.To != \"none\" && seenNone[t.From]) { return errors.New(\"conflicting transformations for \" + t.From) }\n  if t.To == \"none\" { seenNone[t.From] = true } else { seenValid[t.From] = true }\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n  if strings.Contains(err.Error(), \"'none' should be the only transformation\") {\n    // dedupe transformations by From type and re-validate\n  }\n  return err\n}","preventionTips":["Maintain at most one transformation per From type","When merging configs, dedupe by From key instead of appending","Test merged configs with Validate in unit tests"],"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-14T05:17:10.506Z"}