{"record":{"id":"27769c0b0f73df77","repo":"openzipkin/zipkin","slug":"contactpoints-null","errorCode":null,"errorMessage":"contactPoints == null","messagePattern":"contactPoints == null","errorType":"validation","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java","lineNumber":100,"sourceCode":"    if (autocompleteTtl <= 0) throw new IllegalArgumentException(\"autocompleteTtl <= 0\");\n    this.autocompleteTtl = autocompleteTtl;\n    return (B) this;\n  }\n\n  @Override public B autocompleteCardinality(int autocompleteCardinality) {\n    if (autocompleteCardinality <= 0) {\n      throw new IllegalArgumentException(\"autocompleteCardinality <= 0\");\n    }\n    this.autocompleteCardinality = autocompleteCardinality;\n    return (B) this;\n  }\n\n  /**\n   * Comma separated list of host addresses part of Cassandra cluster. You can also specify a custom\n   * port with 'host:port'. Defaults to localhost on port 9042 *\n   */\n  public B contactPoints(String contactPoints) {\n    if (contactPoints == null) throw new NullPointerException(\"contactPoints == null\");\n    this.contactPoints = contactPoints;\n    return (B) this;\n  }\n\n  /**\n   * Name of the datacenter that will be considered \"local\" for latency load balancing. When unset,\n   * load-balancing is round-robin.\n   */\n  public B localDc(String localDc) {\n    if (localDc == null) throw new NullPointerException(\"localDc == null\");\n    this.localDc = localDc;\n    return (B) this;\n  }\n\n  /** Max pooled connections per datacenter-local host. Defaults to 8 */\n  public B maxConnections(int maxConnections) {\n    if (maxConnections <= 0) throw new IllegalArgumentException(\"maxConnections <= 0\");\n    this.poolLocalSize = maxConnections;","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java#L82-L118","documentation":"CassandraStorageBuilder.contactPoints(String) throws NullPointerException ('contactPoints == null') when the comma-separated Cassandra contact-point string is null. Contact points bootstrap the driver session; null means the value was never supplied, and the builder requires it (or you keep the default 'localhost').","triggerScenarios":"Calling contactPoints(null), or passing a null value sourced from an env var/property that was never set (e.g. System.getenv(\"CASSANDRA_HOSTS\") returning null).","commonSituations":"Deployment manifests missing the CASSANDRA_HOSTS/zipkin.storage.cassandra.contact-points variable; local runs assuming a default was applied by the builder (it is not — only server-side property binding applies defaults).","solutions":["Pass a valid contact string, e.g. contactPoints(\"host1:9042,host2:9042\")","Default null config values to \"localhost\" before calling the builder","Add the missing env var / property to the deployment"],"exampleFix":"// before\nString hosts = System.getenv(\"CASSANDRA_HOSTS\"); // null\nbuilder.contactPoints(hosts);\n\n// after\nString hosts = System.getenv(\"CASSANDRA_HOSTS\");\nbuilder.contactPoints(hosts != null ? hosts : \"localhost\");","handlingStrategy":"validation","validationCode":"String contactPoints = System.getenv(\"CASSANDRA_HOSTS\");\nbuilder.contactPoints(contactPoints != null ? contactPoints : \"localhost\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require-or-default every connection string at the config layer","Document the effective contact points at startup in a log line"],"tags":["zipkin","cassandra","contact-points","null-check","configuration"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}