{"record":{"id":"e40778e7ce702884","repo":"jaegertracing/jaeger","slug":"unsupported-schema-version-v","errorCode":null,"errorMessage":"unsupported schema version: %v","messagePattern":"unsupported schema version: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/v1/cassandra/dependencystore/storage.go","lineNumber":94,"sourceCode":"\tdeps := make([]Dependency, len(dependencies))\n\tfor i, d := range dependencies {\n\t\tdeps[i] = Dependency{\n\t\t\tParent: d.Parent,\n\t\t\tChild:  d.Child,\n\t\t\t//nolint:gosec // G115\n\t\t\tCallCount: int64(d.CallCount),\n\t\t\tSource:    string(d.Source),\n\t\t}\n\t}\n\n\tvar query cassandra.Query\n\tswitch s.version {\n\tcase V1:\n\t\tquery = s.session.Query(depsInsertStmtV1, ts, ts, deps)\n\tcase V2:\n\t\tquery = s.session.Query(depsInsertStmtV2, ts, ts.Truncate(tsBucket), deps)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported schema version: %v\", s.version)\n\t}\n\treturn s.dependenciesTableMetrics.Exec(query, s.logger)\n}\n\n// GetDependencies returns all interservice dependencies\nfunc (s *DependencyStore) GetDependencies(_ context.Context, endTs time.Time, lookback time.Duration) ([]model.DependencyLink, error) {\n\tstartTs := endTs.Add(-1 * lookback)\n\tvar query cassandra.Query\n\tswitch s.version {\n\tcase V1:\n\t\tquery = s.session.Query(depsSelectStmtV1, startTs, endTs)\n\tcase V2:\n\t\tquery = s.session.Query(depsSelectStmtV2, getBuckets(startTs, endTs), startTs, endTs)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported schema version: %v\", s.version)\n\t}\n\titer := query.Consistency(cassandra.One).Iter()\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v1/cassandra/dependencystore/storage.go#L76-L112","documentation":"DependencyStore is constructed with a schema version (V1 or V2) that determines the Cassandra insert statement. WriteDependencies returns this error when the store was built with a version outside the known set, meaning the DependencyStore was created with an invalid version value — a construction/programming error, not a Cassandra failure.","triggerScenarios":"Calling WriteDependencies on a DependencyStore created (NewDependencyStore / WithVersion) with a version value other than V1 or V2, e.g. DependencyStoreSchemaVersion(-1) or a zero-value store.","commonSituations":"Passing an uninitialized version struct, casting an integer from config into the version type, or constructing the store manually in tests/embedding code.","solutions":["Validate the schema version at store construction (in the constructor) so writes fail fast at startup instead.","Set the version explicitly with the package's V1/V2 constants when creating the store.","Check the config plumbing that maps Jaeger's cassandra schema-version flag into the store version.","Update tests/embedding code that build DependencyStore without WithVersion."],"exampleFix":"// before\nstore := dependencystore.New(session, logger, metrics, dependencystore.DependencyStoreSchemaVersion(cfg.Version)) // unvalidated\n// after\nswitch cfg.Version {\ncase \"v1\", \"v2\":\n    store = dependencystore.New(session, logger, metrics, schemaVersionFromConfig(cfg))\ndefault:\n    return nil, fmt.Errorf(\"unknown dependency store schema version %q\", cfg.Version)\n}","handlingStrategy":"validation","validationCode":"v := schemaVersionFromConfig(cfg)\nif v != V1 && v != V2 {\n    return nil, fmt.Errorf(\"invalid dependency store schema version: %v\", v)\n}","typeGuard":"func validVersion(v DependencyStoreSchemaVersion) bool { return v == V1 || v == V2 }","tryCatchPattern":"if err := store.WriteDependencies(ctx, ts, deps); err != nil {\n    if strings.Contains(err.Error(), \"unsupported schema version\") {\n        logger.Error(\"dependency store misconfigured: schema version must be V1 or V2\")\n    }\n    return err\n}","preventionTips":["Validate the version in the constructor rather than at each query.","Use the package constants V1/V2 only; never cast raw integers.","Map the --cassandra.schema-version flag to store versions with an explicit allowlist."],"tags":["cassandra","storage","configuration","schema-version"],"backgroundTag":"unsupported-schema-version","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}