{"record":{"id":"b4a082a4906ebefa","repo":"jaegertracing/jaeger","slug":"neither-table-s-nor-s-exist","errorCode":null,"errorMessage":"neither table %s nor %s exist","messagePattern":"neither table (.+?) nor (.+?) exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/storage/v1/cassandra/spanstore/operation_names.go","lineNumber":99,"sourceCode":"\ttable          tableMeta\n\tsession        cassandra.Session\n\twriteCacheTTL  time.Duration\n\tmetrics        *casmetrics.Table\n\toperationNames cache.Cache\n\tlogger         *zap.Logger\n}\n\n// NewOperationNamesStorage returns a new OperationNamesStorage\nfunc NewOperationNamesStorage(\n\tsession cassandra.Session,\n\twriteCacheTTL time.Duration,\n\tmetricsFactory metrics.Factory,\n\tlogger *zap.Logger,\n) (*OperationNamesStorage, error) {\n\tschemaVersion := latestVersion\n\tif !tableExist(session, schemas[schemaVersion].tableName) {\n\t\tif !tableExist(session, schemas[previousVersion].tableName) {\n\t\t\treturn nil, fmt.Errorf(\"neither table %s nor %s exist\",\n\t\t\t\tschemas[schemaVersion].tableName, schemas[previousVersion].tableName)\n\t\t}\n\t\tschemaVersion = previousVersion\n\t}\n\ttable := schemas[schemaVersion]\n\ttable.materialize()\n\n\treturn &OperationNamesStorage{\n\t\tsession:       session,\n\t\tschemaVersion: schemaVersion,\n\t\ttable:         table,\n\t\tmetrics:       casmetrics.NewTable(metricsFactory, schemas[schemaVersion].tableName),\n\t\twriteCacheTTL: writeCacheTTL,\n\t\tlogger:        logger,\n\t\toperationNames: cache.NewLRUWithOptions(\n\t\t\t100000,\n\t\t\t&cache.Options{\n\t\t\t\tTTL:             writeCacheTTL,","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v1/cassandra/spanstore/operation_names.go#L81-L117","documentation":"NewOperationNamesStorage checks which schema version of the operation-names table exists in the Cassandra keyspace. It prefers the latest table but falls back to the previous version; if neither table exists it refuses to start, because it cannot answer operation-name queries against an empty/unschema'd keyspace.","triggerScenarios":"Calling NewSpanReader/NewSpanWriter (or withOperationNamesStorage) against a Cassandra keyspace that lacks both the v2 (operation_names_v2, with span_kind) and v1 (operation_names) tables.","commonSituations":"Pointing Jaeger at a fresh keyspace without running the schema creation script (cassandra-schema.cql / docker run jaeger-tracing-schema tool); connecting to the wrong keyspace; a schema init job that failed silently; manual table drops.","solutions":["Run the Jaeger Cassandra schema initializer against the configured keyspace (jaeger-cassandra-schema image or plugin/schema/cassandra.cql) to create the tables.","Verify you are connected to the intended keyspace (CASSANDRA_KEYSPACE / keyspace config) — a typo lands you in an empty keyspace.","Check that the schema init job completed: inspect system_schema.tables for operation_names_v2 (or operation_names).","If you intentionally run an older schema, create at least the v1 operation_names table so the fallback path works."],"exampleFix":"// before\nsession, _ := cluster.CreateSession() // keyspace \"jaeger_v1\" exists but is empty\nreader, err := spanstore.NewSpanReader(session, ...) // errors\n// after\n// cqlsh: CREATE TABLE jaeger_v1.operation_names_v2 (service_name text, bucket int, operation_name text, span_kind text, PRIMARY KEY ((service_name), operation_name, span_kind));\nreader, err := spanstore.NewSpanReader(session, ...) // succeeds","handlingStrategy":"validation","validationCode":"iter := session.Query(\"SELECT table_name FROM system_schema.tables WHERE keyspace_name = ?\", keyspace).Iter()\nvar tables []string\nvar t string\nfor iter.Scan(&t) {\n    tables = append(tables, t)\n}\n// require operation_names_v2 or operation_names before constructing storage","typeGuard":null,"tryCatchPattern":"writer, err := spanstore.NewSpanWriter(session, metrics, logger, cfg)\nif err != nil {\n    if strings.Contains(err.Error(), \"neither table\") {\n        // run schema initialization then retry startup\n    }\n    return err\n}","preventionTips":["Run the jaeger-cassandra-schema init job as part of deployment before starting collectors/query.","Pin the keyspace name in config and verify it matches the initialized one.","Check table existence in readiness probes using system_schema.tables.","Keep schema script versions in sync with the Jaeger version you deploy."],"tags":["cassandra","schema","storage","startup"],"backgroundTag":"missing-table","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}