pentaho/pentaho-kettle · error · KettleException
SalesforceConnection.Exception.Query
Error message
SalesforceConnection.Exception.Query
What it means
KettleException wrapping any failure from SalesforceConnection.query(), which executes a SOQL query via the Salesforce SOAP partner binding and loads result records. The original exception is logged with a stack tracker and rethrown with the message key 'SalesforceConnection.Exception.Query'. It means the SOQL query or result retrieval failed at the Salesforce API level.
Solutions
- Print the cause (KettleException.getCause()) — SalesforceFault messages name the exact invalid field/object in the SOQL
- Validate the SOQL in the Salesforce Developer Console / Workbench before running the transformation
- Re-connect (reconnect()/connect) if the session expired, and check username/password/security-token settings
- Verify field-level security permissions for the integration user on all queried fields
- Check network/proxy connectivity to the Salesforce endpoint
Example fix
// before
connection.query("SELECT Id, Nam FROM Account");
// after
connection.query("SELECT Id, Name FROM Account"); // fix typo; also wrap in try-catch and log getCause() Defensive patterns
Strategy: try-catch
Validate before calling
if (soql == null || soql.trim().isEmpty() || !soql.trim().toLowerCase().startsWith("select")) throw new IllegalArgumentException("Invalid SOQL: " + soql); Type guard
boolean isExecutable(Connection c) { try { return c != null && c.getConnection() != null; } catch (Exception e) { return false; } } Try / catch
try { connection.query(soql); } catch (KettleException e) { log.logError("SOQL failed: " + e.getCause(), e); /* check session, fix SOQL, retry once */ } Prevention
- Test SOQL in Workbench/Developer Console before wiring it into the step
- Use getAllAvailableObjects(true) and getFields() to build field lists instead of hand-typing
- Call testConnection() before long-running queries and reconnect on session expiry
- Keep transformations under the Salesforce session timeout or schedule re-auth
- Log getCause() always — the Salesforce fault names the exact bad field/object
When it happens
Trigger: Calling query() with invalid SOQL, an object/field name that does not exist, expired or invalid Salesforce session binding, or a network failure while fetching QueryResult batches.
Common situations: Typo'd field names in the step's SOQL, querying objects with restricted field-level security, session timeout on long-running transformations, Salesforce outage or API deprecation of queried fields.
Related errors
- Erreur getting fields from module [
- Error getting fields from module [
- SalesforceUpsert.log.Exception
- Failed in writeToSalesForce:
- Field [ ] couldn't be found in the input stream!
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/e29d682cadb0c429.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforce/SalesforceConnection.java:486
this.sObjects = getQueryResult().getRecords();
this.queryResultSize = getQueryResult().getSize();
}
break;
default:
// return query result
this.qr = isQueryAll() ? getBinding().queryAll( getSQL() ) : getBinding().query( getSQL() );
this.sObjects = getQueryResult().getRecords();
this.queryResultSize = getQueryResult().getSize();
break;
}
if ( this.sObjects != null ) {
this.recordsCount = this.sObjects.length;
} else {
this.recordsCount = 0;
}
} catch ( Exception e ) {
log.logError( Const.getStackTracker( e ) );
throw new KettleException( BaseMessages.getString( PKG, "SalesforceConnection.Exception.Query" ), e );
}
}
public void close() throws KettleException {
try {
if ( !getQueryResult().isDone() ) {
this.qr.setDone( true );
this.qr = null;
}
if ( this.sObjects != null ) {
this.sObjects = null;
}
if ( this.binding != null ) {
this.binding = null;
}
if ( this.loginResult != null ) {
this.loginResult = null;
}View on GitHub (pinned to f3058517a1)