{"record":{"id":"9f0e9ef61ad3b1cc","repo":"t8y2/dbx","slug":"invalid-cassandra-configfile-w","errorCode":null,"errorMessage":"invalid Cassandra configfile: %w","messagePattern":"invalid Cassandra configfile: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":432,"sourceCode":"\t\t}\n\t}\n\tif config.debug {\n\t\tcluster.Logger = gocql.NewLogger(gocql.LogLevelDebug)\n\t}\n\tif err := applyRetryPolicies(cluster, config); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := applyLoadBalancingPolicy(cluster, config); err != nil {\n\t\treturn nil, err\n\t}\n\treturn cluster, nil\n}\n\nfunc (config *cassandraConfig) finalize() error {\n\tvar err error\n\tconfig.configFile, err = normalizeLocalFilePath(config.configFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid Cassandra configfile: %w\", err)\n\t}\n\tconfig.secureConnectBundle, err = normalizeLocalFilePath(config.secureConnectBundle)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid Cassandra secureconnectbundle: %w\", err)\n\t}\n\tif config.secureConnectBundle != \"\" && config.kerberos.enabled {\n\t\treturn fmt.Errorf(\"Cassandra secure connect bundles cannot be combined with Kerberos authentication\")\n\t}\n\tif config.secureConnectBundle != \"\" && (config.username == \"\" || config.password == \"\") {\n\t\treturn fmt.Errorf(\"Cassandra secure connect bundles require username and password credentials\")\n\t}\n\tif config.kerberos.enabled {\n\t\tif err := config.kerberos.finalize(config.username, config.password); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L414-L450","documentation":"finalize() validates the Cassandra agent config before connecting. This error wraps a failure from normalizeLocalFilePath(config.configFile), meaning the local path configured for the driver configfile could not be resolved/normalized (e.g. missing file, unreadable path, or bad expansion). It is thrown when parseCassandraConfig finalizes user-supplied configuration.","triggerScenarios":"Setting the configFile option to a path that normalizeLocalFilePath cannot resolve: a nonexistent file, an empty/unresolvable expansion, or a path with invalid syntax, then calling parseCassandraConfig/finalize.","commonSituations":"Typo in the configfile path, pointing at a file mounted in a different container path, using ~ or env-var expansion that isn't available in the runtime environment, or deploying configs without the file present.","solutions":["Verify the path in configFile exists and is readable from the process: ls -l <path>","Use an absolute path instead of a relative or ~-expanded one","Check that the underlying wrapped error (%w) names the actual cause and fix that","Ensure the config file is copied/mounted into the container or working directory where the agent runs"],"exampleFix":"// before\nconfig.configFile = \"~/cassandra/config.conf\"\n// after\nconfig.configFile = \"/etc/instana/cassandra/config.conf\" // absolute, verified to exist","handlingStrategy":"validation","validationCode":"func validateConfigFile(path string) error {\n\tif path == \"\" {\n\t\treturn nil // optional\n\t}\n\tinfo, err := os.Stat(path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"configfile not accessible: %w\", err)\n\t}\n\tif info.IsDir() {\n\t\treturn fmt.Errorf(\"configfile is a directory: %s\", path)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"cfg, err := parseCassandraConfig(...)\nif err != nil {\n\tvar pathErr *fs.PathError\n\tif errors.As(err, &pathErr) {\n\t\tlog.Fatalf(\"fix configfile path %q: %v\", pathErr.Path, pathErr.Err)\n\t}\n\treturn err\n}","preventionTips":["Use absolute paths for configFile","Mount/copy the config file into containers and verify before startup","Prefer env-var expansion available at runtime over shell-only expansion like ~"],"tags":["cassandra","config","file-path"],"backgroundTag":"invalid-config-file-path","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}