{"record":{"id":"406449c227060124","repo":"jaegertracing/jaeger","slug":"attribute-metadata-cache-max-size-must-be-a-non-ne","errorCode":null,"errorMessage":"attribute_metadata_cache_max_size must be a non-negative number","messagePattern":"attribute_metadata_cache_max_size must be a non-negative number","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/v2/clickhouse/config.go","lineNumber":100,"sourceCode":"\tif cfg.TTL < 0 {\n\t\treturn errors.New(\"ttl must be a non-negative duration\")\n\t}\n\tif cfg.TTL > 0 && cfg.TTL%time.Second != 0 {\n\t\treturn errors.New(\"ttl must be a whole number of seconds\")\n\t}\n\t// A search depth of zero would make every trace search return nothing, and a\n\t// negative one is meaningless, so reject both rather than querying with them.\n\tif cfg.DefaultSearchDepth <= 0 {\n\t\treturn errors.New(\"default_search_depth must be a positive number\")\n\t}\n\tif cfg.MaxSearchDepth <= 0 {\n\t\treturn errors.New(\"max_search_depth must be a positive number\")\n\t}\n\tif cfg.AttributeMetadataCacheTTL < 0 {\n\t\treturn errors.New(\"attribute_metadata_cache_ttl must be a non-negative duration\")\n\t}\n\tif cfg.AttributeMetadataCacheMaxSize < 0 {\n\t\treturn errors.New(\"attribute_metadata_cache_max_size must be a non-negative number\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":82,"sourceCodeEnd":104,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v2/clickhouse/config.go#L82-L104","documentation":"ClickHouse Configuration.Validate returns this error when AttributeMetadataCacheMaxSize is negative. The cache max size bounds how many attribute metadata entries are cached and cannot be negative.","triggerScenarios":"Validating a ClickHouse Configuration whose AttributeMetadataCacheMaxSize is below zero.","commonSituations":"Negative numbers in config files from typos; computing size from a formula that underflows; misreading the option as a boolean/disabled flag and using -1.","solutions":["Set attribute_metadata_cache_max_size to a non-negative number","Replace -1 with an appropriate positive size (the option does not use -1 as a \"disabled\" sentinel)","Add Validate to the startup path so the bad value fails fast"],"exampleFix":"// before\nattribute_metadata_cache_max_size: -1\n// after\nattribute_metadata_cache_max_size: 10000","handlingStrategy":"validation","validationCode":"if cfg.AttributeMetadataCacheMaxSize < 0 {\n    return errors.New(\"attribute_metadata_cache_max_size must be a non-negative number\")\n}","typeGuard":"func nonNegativeSize(n int) bool { return n >= 0 }","tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"attribute_metadata_cache_max_size must be a non-negative number\") {\n        cfg.AttributeMetadataCacheMaxSize = 10000\n    }\n}","preventionTips":["Don't use -1 as a 'disabled' sentinel for cache size","Guard computed sizes against underflow","Validate deployment configs before rollout"],"tags":["clickhouse","configuration","cache","jaeger"],"backgroundTag":"invalid-config-value","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}