{"record":{"id":"6f459788b5b67464","repo":"owasp-amass/amass","slug":"failed-to-obtain-the-ttl-for-transformation-s-s","errorCode":null,"errorMessage":"failed to obtain the TTL for transformation %s->%s","messagePattern":"failed to obtain the TTL for transformation (.+?)->(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"engine/plugins/support/support.go","lineNumber":111,"sourceCode":"}\n\nfunc Shutdown() {\n\tclose(done)\n}\n\nfunc TTLStartTime(c *config.Config, from, to, plugin string) (time.Time, error) {\n\tnow := time.Now()\n\n\tif matches, err := c.CheckTransformations(from, to, plugin); err == nil && matches != nil {\n\t\tif ttl := matches.TTL(plugin); ttl >= 0 {\n\t\t\treturn now.Add(time.Duration(-ttl) * time.Minute), nil\n\t\t}\n\t\tif ttl := matches.TTL(to); ttl >= 0 {\n\t\t\treturn now.Add(time.Duration(-ttl) * time.Minute), nil\n\t\t}\n\t}\n\n\treturn time.Time{}, fmt.Errorf(\"failed to obtain the TTL for transformation %s->%s\", from, to)\n}\n\nfunc GetAPI(name string, e *et.Event) (string, error) {\n\t// TODO: Add support for multiple API keys\n\tdsc := e.Session.Config().GetDataSourceConfig(name)\n\tif dsc == nil || len(dsc.Creds) == 0 {\n\t\treturn \"\", errors.New(\"no API key found\")\n\t}\n\n\tfor _, cred := range dsc.Creds {\n\t\tif cred != nil && cred.Apikey != \"\" {\n\t\t\treturn cred.Apikey, nil\n\t\t}\n\t}\n\n\treturn \"\", errors.New(\"no API key found\")\n}\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/support/support.go#L93-L129","documentation":"TTLStartTime computes when a transformation's cached data was last considered valid by consulting TTL matches for the from->to transformation pair. If no TTL match exists for that transformation, it returns this error along with a zero time.Time. The caller uses the result to build a time-travel cutoff for cached DB queries, so the error means the TTL configuration for this transformation edge is absent.","triggerScenarios":"Calling TTLStartTime with a from/to transformation pair that has no entry in the event/session TTL matches; matches.TTL(to) returns a negative value (no configured TTL) for every candidate, so the function reaches the final return.","commonSituations":"Missing or incomplete transformation TTL configuration (e.g. no TTLs loaded from config for this edge); typo in the transformation names so they don't match configured TTL entries; a new transformation added without adding a corresponding TTL entry; running with a config that disables/omits TTLs entirely.","solutions":["Add a TTL entry for the missing from->to transformation in the session/config TTL settings","Verify the from and to transformation names exactly match those in the TTL configuration","Log/print available TTL keys to confirm which transformations are configured","Fall back to a sensible default (e.g. time.Time{} or a fixed window) in the caller when TTL is unconfigured","Check that the config file providing TTLs was actually loaded (no silent config-load failure)"],"exampleFix":"// before\nstart, err := support.TTLStartTime(ctx, sess, event, from, to)\nif err != nil {\n    return fmt.Errorf(\"TTL error: %v\", err)\n}\n// after\nstart, err := support.TTLStartTime(ctx, sess, event, from, to)\nif err != nil {\n    start = time.Time{} // no TTL configured: use full history\n}","handlingStrategy":"fallback","validationCode":"// Go: check the transformation has a TTL configured before calling\nif sess.TTL(to) < 0 {\n    // no TTL for this transformation: skip TTLStart or use zero time\n    start = time.Time{}\n} else {\n    start, _ = support.TTLStartTime(ctx, sess, event, from, to)\n}","typeGuard":"func isTTLNotConfigured(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"failed to obtain the TTL for transformation\")\n}","tryCatchPattern":"start, err := support.TTLStartTime(ctx, sess, event, from, to)\nif err != nil {\n    if isTTLNotConfigured(err) {\n        start = time.Time{} // default: full history\n    } else {\n        return err\n    }\n}","preventionTips":["Define TTL entries for every transformation edge your pipeline uses","When adding new transformations, add matching TTL config in the same change","Validate TTL config at startup (warn on transformations referenced without TTLs)","Use exact transformation names in config to avoid silent mismatches"],"tags":["ttl","cache","configuration","transformation"],"backgroundTag":"missing-config-value","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"}