{"record":{"id":"e780545ed28eb248","repo":"apache/beam","slug":"please-provide-a-driver-provider","errorCode":null,"errorMessage":"please provide a driver provider","messagePattern":"please provide a driver provider","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":590,"sourceCode":"      }\n\n      TransactionConfig transactionConfig = getTransactionConfig();\n      if (transactionConfig == null) {\n        transactionConfig = TransactionConfig.empty();\n      }\n\n      Boolean writeTransaction = getProvidedValue(getWriteTransaction());\n      if (writeTransaction == null) {\n        writeTransaction = Boolean.FALSE;\n      }\n\n      Boolean logCypher = getProvidedValue(getLogCypher());\n      if (logCypher == null) {\n        logCypher = Boolean.FALSE;\n      }\n\n      if (driverProviderFn == null) {\n        throw new RuntimeException(\"please provide a driver provider\");\n      }\n      if (rowMapper == null) {\n        throw new RuntimeException(\"please provide a row mapper\");\n      }\n      if (parametersFunction == null) {\n        parametersFunction = t -> Collections.emptyMap();\n      }\n\n      ReadFn<ParameterT, OutputT> readFn =\n          new ReadFn<>(\n              driverProviderFn,\n              sessionConfig,\n              transactionConfig,\n              cypher,\n              rowMapper,\n              parametersFunction,\n              writeTransaction,\n              logCypher);","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java#L572-L608","documentation":"Neo4JIO.Read/Write's expand requires a driver provider function (withDriverProviderFn) that knows how to create the Neo4j Driver in workers. When it is null at expansion time, the pipeline cannot be built and a RuntimeException \"please provide a driver provider\" is thrown.","triggerScenarios":"Building a Neo4jIO.read()/write() transform without calling .withDriverProviderFn(...) (and no default is in effect) before running the pipeline.","commonSituations":"Omitting driver setup while specifying only cypher/parameters; refactoring that dropped the withDriverProviderFn call; confusing Neo4jIO with other connectors that default-construct drivers; conditional builder code that never sets the provider on some branch.","solutions":["Add a driver provider: .withDriverProviderFn(ignored -> GraphDatabase.driver(uri, AuthTokens.basic(user, password))).","Alternatively supply URL/username/password via withUrl/withUsername/withPassword plus withDriverConfig so the default provider path can build the driver.","Verify the builder chain: ensure withDriverProviderFn is called on the same instance (builders return new objects if misused).","Reuse Neo4jIO.readConfiguration()/writeConfiguration() helpers that assemble all required providers consistently."],"exampleFix":"// before\nNeo4jIO.<Row>read().withCypher(\"MATCH (n) RETURN n\")\n// after\nNeo4jIO.<Row>read()\n  .withCypher(\"MATCH (n) RETURN n\")\n  .withDriverProviderFn(opts -> GraphDatabase.driver(\"neo4j://localhost:7687\", AuthTokens.basic(\"neo4j\", pass)))","handlingStrategy":"validation","validationCode":"Neo4jIO.Read<Row> read = Neo4jIO.read();\nif (read == null || !isConfigured(read)) {\n  throw new IllegalStateException(\"Call .withDriverProviderFn(...) (or withUrl/username/password) before running\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  pipeline.apply(Neo4jIO.read()...);\n} catch (RuntimeException e) {\n  if (\"please provide a driver provider\".equals(e.getMessage())) {\n    throw new IllegalStateException(\"Neo4jIO requires withDriverProviderFn or URL+credentials configuration\");\n  }\n  throw e;\n}","preventionTips":["Always chain withDriverProviderFn (or the URL/credentials trio) in the same builder expression.","Centralize Neo4jIO transform construction in one factory method so required calls are never skipped.","Cover pipeline construction in a fast unit test that runs expand eagerly (e.g. with a Create + direct runner)."],"tags":["neo4j","apache-beam","missing-argument","pipeline"],"backgroundTag":"missing-required-argument","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}