{"record":{"id":"677fd7669e92ce23","repo":"jaegertracing/jaeger","slug":"invalid-version","errorCode":null,"errorMessage":"invalid version","messagePattern":"invalid version","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/v1/cassandra/dependencystore/storage.go","lineNumber":46,"sourceCode":"\nconst (\n\t// V1 is used when the dependency table is SASI indexed.\n\tV1 Version = iota\n\n\t// V2 is used when the dependency table is NOT SASI indexed.\n\tV2\n\tversionEnumEnd\n\n\tdepsInsertStmtV1 = \"INSERT INTO dependencies(ts, ts_index, dependencies) VALUES (?, ?, ?)\"\n\tdepsInsertStmtV2 = \"INSERT INTO dependencies_v2(ts, ts_bucket, dependencies) VALUES (?, ?, ?)\"\n\tdepsSelectStmtV1 = \"SELECT ts, dependencies FROM dependencies WHERE ts_index >= ? AND ts_index < ?\"\n\tdepsSelectStmtV2 = \"SELECT ts, dependencies FROM dependencies_v2 WHERE ts_bucket IN ? AND ts >= ? AND ts < ?\"\n\n\t// TODO: Make this customizable.\n\ttsBucket = 24 * time.Hour\n)\n\nvar errInvalidVersion = errors.New(\"invalid version\")\n\n// DependencyStore handles all queries and insertions to Cassandra dependencies\ntype DependencyStore struct {\n\tsession                  cassandra.Session\n\tdependenciesTableMetrics *casmetrics.Table\n\tlogger                   *zap.Logger\n\tversion                  Version\n}\n\n// NewDependencyStore returns a DependencyStore\nfunc NewDependencyStore(\n\tsession cassandra.Session,\n\tmetricsFactory metrics.Factory,\n\tlogger *zap.Logger,\n\tversion Version,\n) (*DependencyStore, error) {\n\tif !version.IsValid() {\n\t\treturn nil, errInvalidVersion","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v1/cassandra/dependencystore/storage.go#L28-L64","documentation":"errInvalidVersion is declared in internal/storage/v1/cassandra/dependencystore/storage.go and returned by NewDependencyStore when the caller requests a dependency-store table version the package does not implement. The store supports versioned schemas (e.g. the v2 table 'dependencies_v2' referenced by depsSelectStmtV2), so NewDependencyStore takes a version parameter to pick the right statements. Any version outside the supported set cannot be mapped to a known table/queries, so construction fails fast instead of issuing queries against a non-existent table.","triggerScenarios":"Calling cassandra dependencystore.NewDependencyStore with a version argument that is not one of the supported constants (e.g. passing 3 or 0 when only 1 and 2 are supported), or wiring a config value straight into that parameter without normalizing it.","commonSituations":"A storage backend config carries an unknown or stale 'dependency store version' value (hand-edited YAML, version bumped for a future release before this binary supports it, or an operator copying config from a newer Jaeger version); tests or plugins constructing the store programmatically with a wrong literal.","solutions":["Check the version argument passed to NewDependencyStore and set it to a supported value (the latest version the code declares, e.g. 2 for the dependencies_v2 table).","If the version comes from configuration, validate/clamp it at config-load time before reaching NewDependencyStore.","If you intend to use a newer table version, upgrade the Jaeger binary to one whose dependencystore package supports that version.","If you believe the version should be supported, inspect storage.go for the switch over version constants and add support in a code change with tests."],"exampleFix":"// before\nstore, err := dependencystore.NewDependencyStore(session, logger, metrics, 3) // invalid\n// after\nstore, err := dependencystore.NewDependencyStore(session, logger, metrics, 2)","handlingStrategy":"validation","validationCode":"const maxDepStoreVersion = 2 // check storage.go for supported versions\nif v < 1 || v > maxDepStoreVersion {\n    return nil, fmt.Errorf(\"dependency store version %d not supported\", v)\n}","typeGuard":null,"tryCatchPattern":"store, err := dependencystore.NewDependencyStore(session, logger, metrics, cfg.Version)\nif err != nil {\n    return fmt.Errorf(\"constructing dependency store: %w\", err)\n}","preventionTips":["Derive the version from a named constant in the package, never a raw literal or raw config pass-through.","Validate the configured version at config-load time with a whitelist."],"tags":["cassandra","storage","configuration","dependency-store"],"backgroundTag":"unsupported-version-value","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}