apache/seatunnel · error · Neo4jConnectorException
CONFIG_VALIDATION_FAILED
CONFIG_VALIDATION_FAILED
Error message
Invalid Field
What it means
DriverBuilder.build() creates a Neo4j Driver using one of three auth schemes (basic username/password, bearer token, kerberos ticket). If none of these credential fields is present after option validation, it throws Neo4jConnectorException with SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED and the terse message 'Invalid Field'. It means the sink/source configuration is missing any usable authentication method.
Source
Thrown at seatunnel-connectors-v2/connector-neo4j/src/main/java/org/apache/seatunnel/connectors/seatunnel/neo4j/config/DriverBuilder.java:77
configBuilder
.withConnectionAcquisitionTimeout(
maxConnectionTimeoutSeconds * 2, TimeUnit.SECONDS)
.withConnectionTimeout(maxConnectionTimeoutSeconds, TimeUnit.SECONDS);
}
if (maxTransactionRetryTimeSeconds != null) {
configBuilder.withMaxTransactionRetryTime(
maxTransactionRetryTimeSeconds, TimeUnit.SECONDS);
}
Config config = configBuilder.build();
if (username != null) {
return GraphDatabase.driver(uri, AuthTokens.basic(username, password), config);
} else if (bearerToken != null) {
return GraphDatabase.driver(uri, AuthTokens.bearer(bearerToken), config);
} else if (kerberosTicket != null) {
return GraphDatabase.driver(uri, AuthTokens.kerberos(kerberosTicket), config);
}
throw new Neo4jConnectorException(
SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED, "Invalid Field");
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Add username and password to the Neo4j connector config, or provide a bearer token / kerberos ticket
- Verify option names against Neo4jSource/SinkOptions (password, bearer-token, kerberos-ticket) — typos silently leave fields null
- Run with ConfigBuilder/checkConfig to catch missing required options before job submission
Example fix
// before
Neo4j { uri = "bolt://localhost:7687" query = "..." } // no auth
// after
Neo4j { uri = "bolt://localhost:7687" username = "neo4j" password = "secret" query = "..." } Defensive patterns
Strategy: validation
Validate before calling
boolean authOk = config.hasPath("username") && config.hasPath("password") || config.hasPath("bearer-token") || config.hasPath("kerberos-ticket"); Try / catch
try { sink.write(row); } catch (Neo4jConnectorException e) { if (e.getMessage().equals("Invalid Field")) { throw new IllegalArgumentException("missing neo4j auth config", e); } throw e; } Prevention
- Always set username+password or an explicit auth alternative
- Verify option names against the connector's Option definitions
- Run config validation before submitting the job
When it happens
Trigger: Creating a Neo4j source/sink whose config has neither username+password, bearer token, nor kerberos ticket set — e.g. omitting 'username'/'password' options or misnaming them in the HOCON config.
Common situations: Copy-pasting a config template without filling auth fields; typo'd option names (so OptionValidation passes defaults but fields are null); switching from password to token auth and deleting both.
Understand the failure class
Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.
Related errors
- CONFIG_VALIDATION_FAILED
- UNSUPPORTED_DATA_TYPE
- Option '${valuesAndOptions[index + 1]}' is not valid for the
- AzureCosmosDB requires key, primary_key, secondary_key, or a
- Invalid user/password specified
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/0c09ab9781bf6a72.
Report an issue: GitHub.