{"record":{"id":"5f8a807e4ce4b8bc","repo":"googleapis/mcp-toolbox","slug":"unable-to-create-session-v-5f8a80","errorCode":null,"errorMessage":"unable to create session: %v","messagePattern":"unable to create session: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/scylladb/scylladb.go","lineNumber":73,"sourceCode":"\t// LocalDC enables DC-aware token-aware load balancing. Required for\n\t// ScyllaDB Cloud connections (e.g. \"AWS_US_EAST_1\").\n\tLocalDC string `yaml:\"localDC\"`\n\t// DisableInitialHostLookup disables the initial host discovery step.\n\t// Set to true when connecting through a proxy, port-forward, or in\n\t// containerized environments where the cluster's internal IPs are not\n\t// reachable from the client.\n\tDisableInitialHostLookup bool   `yaml:\"disableInitialHostLookup\"`\n\tCAPath                   string `yaml:\"caPath\"`\n\tCertPath                 string `yaml:\"certPath\"`\n\tKeyPath                  string `yaml:\"keyPath\"`\n\tEnableHostVerification   bool   `yaml:\"enableHostVerification\"`\n}\n\n// Initialize implements sources.SourceConfig.\nfunc (c Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error) {\n\tsession, err := initScyllaDBSession(ctx, tracer, c)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create session: %v\", err)\n\t}\n\ts := &Source{\n\t\tConfig:  c,\n\t\tSession: session,\n\t}\n\treturn s, nil\n}\n\n// SourceConfigType implements sources.SourceConfig.\nfunc (c Config) SourceConfigType() string {\n\treturn SourceType\n}\n\nvar _ sources.SourceConfig = Config{}\n\ntype Source struct {\n\tConfig\n\tSession *gocql.Session","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/scylladb/scylladb.go#L55-L91","documentation":"Initialize for the ScyllaDB source wraps any failure from initScyllaDBSession with this message. Any problem creating the gocql CQL session — bad hosts, auth, keyspace, protocol version — surfaces as 'unable to create session'. The original cause is embedded in %v.","triggerScenarios":"Config.Initialize calls initScyllaDBSession, which validates config, builds a gocql.ClusterConfig, and calls cluster.CreateSession(); any returned error is wrapped here. Includes both the config-validation error and the session-creation error.","commonSituations":"Password set without username (config validation failure); unreachable contact points; wrong protoVersion for the server; keyspace does not exist; authentication credentials rejected.","solutions":["Read the wrapped cause: if it says 'password provided without a username', add a username or remove the password.","If connection refused/timeout, check `hosts` are reachable: `cqlsh <host> 9042`.","If keyspace errors, create the keyspace first or fix the `keyspace` field spelling.","Match `protoVersion` to the server (ScyllaDB supports v3/v4; set explicitly if negotiation fails).","Verify username/password against the ScyllaDB authenticator settings."],"exampleFix":"// before\nsources:\n  my-scylla:\n    kind: scylladb\n    hosts: [\"10.0.0.1:9042\"]\n    password: secret\n// after\nsources:\n  my-scylla:\n    kind: scylladb\n    hosts: [\"10.0.0.1:9042\"]\n    username: cassandra\n    password: secret","handlingStrategy":"validation","validationCode":"# Validate ScyllaDB source config before startup\npython3 - <<'EOF'\nimport os, socket\nhosts = os.environ.get('SCYLLA_HOSTS','').split(',')\nuser, pw = os.environ.get('SCYLLA_USER',''), os.environ.get('SCYLLA_PASS','')\nassert not (pw and not user), \"password set without username\"\nfor h in hosts:\n    host, _, port = h.partition(':')\n    s = socket.socket(); s.settimeout(3)\n    s.connect((host, int(port or 9042))); s.close()\nprint(\"scylla config OK\")\nEOF","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce password⇒username pairing in your config validation (mirrors the source's own check).","Pre-create the keyspace before referencing it in config.","Pin protoVersion explicitly when you know the server version.","Smoke-test contact points with cqlsh before deploying."],"tags":["scylladb","cassandra","session","go"],"backgroundTag":"connection-failed","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}