{"record":{"id":"949c4666be4e61f0","repo":"jaegertracing/jaeger","slug":"dependencies-ttl-can-either-be-0-or-greater-than-o","errorCode":null,"errorMessage":"dependencies_ttl can either be 0 or greater than or equal to 1 second","messagePattern":"dependencies_ttl can either be 0 or greater than or equal to 1 second","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/cassandra/config/config.go","lineNumber":206,"sourceCode":"\treturn fmt.Sprintf(\"%+v\", *c)\n}\n\nfunc isValidTTL(duration time.Duration) bool {\n\treturn duration == 0 || duration >= time.Second\n}\n\nfunc (c *Configuration) Validate() error {\n\t_, err := govalidator.ValidateStruct(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !isValidTTL(c.Schema.TraceTTL) {\n\t\treturn errors.New(\"trace_ttl can either be 0 or greater than or equal to 1 second\")\n\t}\n\n\tif !isValidTTL(c.Schema.DependenciesTTL) {\n\t\treturn errors.New(\"dependencies_ttl can either be 0 or greater than or equal to 1 second\")\n\t}\n\n\tif c.Schema.CompactionWindow < time.Minute {\n\t\treturn errors.New(\"compaction_window should at least be 1 minute\")\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":188,"sourceCodeEnd":215,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/cassandra/config/config.go#L188-L215","documentation":"Validate() in the Cassandra storage config rejects a Schema.DependenciesTTL that is neither 0 nor at least 1 second. Like trace_ttl, the dependencies TTL must be disabled (0) or a whole number of seconds or greater, because Cassandra schema TTLs cannot express sub-second durations.","triggerScenarios":"Calling Validate on a cassandra.Configuration where c.Schema.DependenciesTTL is strictly between 0 and 1 second (e.g. 100ms), during storage extension start or config tests.","commonSituations":"Sub-second dependencies_ttl from a misread YAML duration; env parsing producing small durations; copying trace_ttl tuning patterns to dependencies_ttl with wrong units.","solutions":["Set Schema.DependenciesTTL to >= 1 * time.Second (commonly several days, e.g. 504h).","Set it to 0 to disable dependencies TTL management.","Double-check the duration string/unit in the configuration source."],"exampleFix":"// before\ncfg.Schema.DependenciesTTL = 100 * time.Millisecond\n// after\ncfg.Schema.DependenciesTTL = 504 * time.Hour","handlingStrategy":"validation","validationCode":"if ttl != 0 && ttl < time.Second {\n    return errors.New(\"dependencies_ttl must be 0 or >= 1s\")\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    logger.Fatal(\"invalid cassandra config\", zap.Error(err))\n}","preventionTips":["Use multi-day TTLs for dependencies (e.g. 504h) or 0 to disable.","Avoid sub-second duration strings in YAML/env config.","Validate config in CI before deployment."],"tags":["cassandra","config","ttl"],"backgroundTag":"invalid-config-value","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}