{"record":{"id":"fb5e90ca2e9dad6c","repo":"apache/beam","slug":"please-provide-a-neo4j-config","errorCode":null,"errorMessage":"please provide a neo4j config","messagePattern":"please provide a neo4j config","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java","lineNumber":370,"sourceCode":"          useDefault);\n      return builder().setHasDefaultConfig(useDefault).build();\n    }\n\n    void populateDisplayData(DisplayData.Builder builder) {\n      builder.addIfNotNull(DisplayData.item(\"neo4j-url\", getUrl()));\n      builder.addIfNotNull(DisplayData.item(\"neo4j-username\", getUsername()));\n      builder.addIfNotNull(\n          DisplayData.item(\n              \"neo4j-password\", getPassword() != null ? \"<provided>\" : \"<not-provided>\"));\n    }\n\n    Driver buildDriver() {\n      // Create the Neo4j Driver\n      // This uses the provided Neo4j configuration along with URLs, username and password\n      //\n      Config config = getConfig();\n      if (config == null) {\n        throw new RuntimeException(\"please provide a neo4j config\");\n      }\n      // We're trying to work around a subtle serialisation bug in the Neo4j Java driver.\n      // The fix is work in progress.  For now, we harden our code to avoid\n      // wild goose chases.\n      //\n      Boolean hasDefaultConfig = getProvidedValue(getHasDefaultConfig());\n      if (hasDefaultConfig != null && hasDefaultConfig) {\n        config = Config.defaultConfig();\n      }\n\n      // Get the list of the URI to connect with\n      //\n      List<URI> uris = new ArrayList<>();\n      String url = getProvidedValue(getUrl());\n      if (url != null) {\n        try {\n          uris.add(new URI(url));\n        } catch (URISyntaxException e) {","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java#L352-L388","documentation":"Neo4jIO's buildDriver requires a driver configuration (a function providing Config / connection settings). getConfig() returned null, meaning no neo4j config provider was supplied to the connector, so it cannot construct the Neo4j Driver and throws RuntimeException.","triggerScenarios":"Using Neo4jIO.read()/write() without calling .withDriverConfig(...) (or the config supplier returns null), then running the pipeline so expand -> buildDriver executes.","commonSituations":"Forgetting withDriverConfig when using a custom driver provider; passing a null/empty config function in builder code; copying example pipelines and removing the config line.","solutions":["Add a driver config to the transform: .withDriverConfig(Config.builder().withoutEncryption().build()) or your tuned Config.","If using withDriverProviderFn, make sure it internally supplies a non-null config or rely on the default config path.","Check that the config supplier doesn't return null at runtime (e.g. options-based lookup failing)."],"exampleFix":"// before\nNeo4jIO.<Row>read().withDriverProviderFn(providerFn)\n// after\nNeo4jIO.<Row>read()\n  .withDriverProviderFn(providerFn)\n  .withDriverConfig(Config.builder().withoutEncryption().build())","handlingStrategy":"validation","validationCode":"Config cfg = getConfig();\nif (cfg == null) {\n  throw new IllegalStateException(\"withDriverConfig(...) must be called before running Neo4jIO\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  Driver d = buildDriver();\n} catch (RuntimeException e) {\n  if (\"please provide a neo4j config\".equals(e.getMessage())) {\n    throw new IllegalStateException(\"Add .withDriverConfig(Config.builder()...build())\", e);\n  }\n  throw e;\n}","preventionTips":["Always call withDriverConfig (even Config.builder().build()) when using a custom driver provider.","Use Neo4jIO.readConfiguration()/writeConfiguration() helpers that set required pieces.","Assert the builder state in pipeline construction tests."],"tags":["neo4j","apache-beam","configuration","driver"],"backgroundTag":"missing-required-config","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}