{"record":{"id":"37970144dceb9252","repo":"googleapis/mcp-toolbox","slug":"failed-to-create-scylladb-session-w","errorCode":null,"errorMessage":"failed to create ScyllaDB session: %w","messagePattern":"failed to create ScyllaDB session: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/scylladb/scylladb.go","lineNumber":181,"sourceCode":"\t\t\tUsername: c.Username,\n\t\t\tPassword: c.Password,\n\t\t}\n\t}\n\n\t// Configure SSL options if any are specified\n\tif c.CAPath != \"\" || c.CertPath != \"\" || c.KeyPath != \"\" || c.EnableHostVerification {\n\t\tcluster.SslOpts = &gocql.SslOptions{\n\t\t\tCaPath:                 c.CAPath,\n\t\t\tCertPath:               c.CertPath,\n\t\t\tKeyPath:                c.KeyPath,\n\t\t\tEnableHostVerification: c.EnableHostVerification,\n\t\t}\n\t}\n\n\t// Create session\n\tsession, err := cluster.CreateSession()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create ScyllaDB session: %w\", err)\n\t}\n\treturn session, nil\n}\n","sourceCodeStart":163,"sourceCodeEnd":185,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/scylladb/scylladb.go#L163-L185","documentation":"After building the gocql.ClusterConfig, initScyllaDBSession calls cluster.CreateSession(), which opens connections to the contact points (and performs host discovery). Any failure — unreachable hosts, auth rejection, keyspace not existing, protocol mismatch — is wrapped with this message. The wrapped error contains the driver's specific cause.","triggerScenarios":"Config.Initialize → initScyllaDBSession → cluster.CreateSession() fails: no host reachable at hosts:port, handshake/auth rejected, `keyspace` does not exist, protoVersion unsupported, or TLS handshake fails.","commonSituations":"ScyllaDB container not started or wrong port (native transport 9042 not exposed); firewall between toolbox and cluster; keyspace name typo; authenticator PasswordAuthenticator with wrong credentials; ProtoVersion too high for the server.","solutions":["Confirm reachability: `cqlsh <host> 9042` or `nc -zv <host> 9042` from the toolbox host.","If the error mentions the keyspace, create it (`CREATE KEYSPACE ...`) or fix the `keyspace` field.","If authentication errors, verify username/password against the cluster's authenticator config.","Set `protoVersion` explicitly (e.g. 4 or 3) if protocol negotiation errors appear.","Ensure `hosts` entries include the correct port and that the CQL native transport is enabled."],"exampleFix":"// before\nsources:\n  scylla:\n    kind: scylladb\n    hosts: [\"localhost:9142\"]\n    keyspace: myKeySpace\n// after (correct port and existing keyspace)\nsources:\n  scylla:\n    kind: scylladb\n    hosts: [\"localhost:9042\"]\n    keyspace: my_keyspace","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# Verify CQL native transport reachability before starting the toolbox\nHOST=scylla; PORT=9042\nnc -zv \"$HOST\" \"$PORT\" || { echo \"$HOST:$PORT unreachable\"; exit 1; }\n# Confirm keyspace exists (via cqlsh)\ncqlsh \"$HOST\" \"$PORT\" -e \"DESCRIBE KEYSPACES\" | grep -q my_keyspace \\\n  || { echo \"keyspace missing\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Readiness-check the cluster (cqlsh ping equivalent) before launching the toolbox.","Verify keyspace names are created and case-correct (CQL lowercases unquoted identifiers).","Pin protoVersion to the value your server supports to avoid negotiation failures.","Keep hosts list to reachable contact points with the correct 9042 native port."],"tags":["scylladb","gocql","connection","go"],"backgroundTag":"connection-refused","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"}