{"record":{"id":"1e40177bb3b061bb","repo":"t8y2/dbx","slug":"load-cassandra-secure-connect-bundle-w","errorCode":null,"errorMessage":"load Cassandra secure connect bundle: %w","messagePattern":"load Cassandra secure connect bundle: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":359,"sourceCode":"\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported Cassandra URL parameter: %s\", rawKey)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (config cassandraConfig) clusterConfig(keyspace string) (*gocql.ClusterConfig, error) {\n\tvar cluster *gocql.ClusterConfig\n\tvar err error\n\tif config.secureConnectBundle != \"\" {\n\t\tcluster, err = gocqlastra.NewClusterFromBundle(\n\t\t\tconfig.secureConnectBundle,\n\t\t\tconfig.username,\n\t\t\tconfig.password,\n\t\t\tconfig.connectTimeout,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"load Cassandra secure connect bundle: %w\", err)\n\t\t}\n\t} else {\n\t\tcluster = gocql.NewCluster(config.hosts...)\n\t\tcluster.Port = config.port\n\t\tcluster.Dialer = cassandraDialer{\n\t\t\ttimeout:    config.connectTimeout,\n\t\t\tkeepAlive:  config.keepAlive,\n\t\t\ttcpNoDelay: config.tcpNoDelay,\n\t\t}\n\t\tcluster.DisableInitialHostLookup = config.disableInitialHostLookup\n\t\tcluster.IgnorePeerAddr = config.disableInitialHostLookup\n\t}\n\tcluster.Keyspace = strings.TrimSpace(keyspace)\n\tcluster.Timeout = config.requestTimeout\n\tcluster.ConnectTimeout = config.connectTimeout\n\tcluster.WriteTimeout = config.requestTimeout\n\tcluster.NumConns = config.numConnections\n\tcluster.PageSize = config.pageSize","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L341-L377","documentation":"When a secure connect bundle is configured, clusterConfig calls a bundle loader with the bundle path, credentials, and connect timeout; any failure is wrapped as 'load Cassandra secure connect bundle: ...'. This typically means the bundle file could not be read or unpacked (missing file, bad path, corrupt zip, or permission denied) when building the gocql cluster for DataStax Astra/cloud setups.","triggerScenarios":"sessionFor -> clusterConfig with config.secureConnectBundle set and the loader returning an error: nonexistent path, unreadable file, invalid/corrupt bundle archive, or wrong credentials format inside the bundle metadata.","commonSituations":"Mounting the Astra secure-connect ZIP at the wrong path in containers; relative vs absolute path confusion after changing working directory; truncated bundle download; stale bundle after rotating Astra databases; file permissions blocking the agent user.","solutions":["Verify the secureConnectBundle path exists and is readable by the process (ls -l / test -r)","Re-download the secure connect bundle from Astra and confirm the ZIP is not truncated","Use an absolute path to the bundle and remount/copy it into the container if missing","Confirm username/password passed alongside the bundle are correct and the timeout is not too small"],"exampleFix":"// before\nconfig.secureConnectBundle = \"secure-connect.zip\"\n// after\nconfig.secureConnectBundle = \"/etc/cassandra/secure-connect-mydb.zip\" // absolute, verified readable","handlingStrategy":"try-catch","validationCode":"func bundleReadable(path string) error {\n\tf, err := os.Open(path)\n\tif err != nil { return fmt.Errorf(\"bundle not readable: %w\", err) }\n\tdefer f.Close()\n\tinfo, err := f.Stat()\n\tif err != nil || info.IsDir() || info.Size() < 100 { return errors.New(\"bundle missing or too small\") }\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"cluster, err := sessionFor(config)\nif err != nil {\n\tif strings.Contains(err.Error(), \"load Cassandra secure connect bundle\") {\n\t\treturn fmt.Errorf(\"check secureConnectBundle path/permissions and re-download bundle: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Use absolute paths for the secure connect bundle","Verify the bundle mounts correctly in containers at startup","Re-download bundles after Astra database rotation","Check file permissions for the agent's service user"],"tags":["config","ssl","secure-connect-bundle","file-io","cassandra","astra"],"backgroundTag":"secure-connect-bundle-load-failed","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}