pentaho/pentaho-kettle · error · KettleException
Error while dropping table
Error message
Error while dropping table
What it means
This KettleException wraps any failure that occurs while executing the 'DROP TABLE <schema.table>' SQL statement against MonetDB via the MAPI socket in the MonetDBBulkLoader step's drop() method. It is thrown when the underlying MAPI connection cannot be established or the server rejects the DDL statement, and it preserves the original exception as the cause.
Solutions
- Verify the MonetDB connection (host, port, user, password) is correct and the server is reachable, e.g. test with mclient
- Check the DB user has DROP/DDL privileges on the target schema
- Confirm data.schemaTable matches an existing fully-qualified table name (schema.table)
- Read the wrapped cause exception for the exact MAPI/server error message
Example fix
// before
executeSql( "drop table " + data.schemaTable );
// after
// guard: only drop if the table actually exists, and fail with server detail
if ( tableExists( data.schemaTable ) ) {
executeSql( "drop table " + data.schemaTable );
} Defensive patterns
Strategy: try-catch
Validate before calling
// before running the step, verify connectivity and privileges
DatabaseMeta dm = meta.getDatabaseMeta();
if ( dm == null || dm.getHostname() == null ) throw new KettleException( "No MonetDB connection defined" );
try ( Connection c = dm.getConnection() ) { /* select 1 */ } Type guard
if ( meta == null || meta.getDatabaseMeta() == null ) { skip/repair step configuration; } Try / catch
try { loader.drop(); } catch ( KettleException e ) { log.error( "drop failed for " + e.getMessage(), e.getCause() ); if ( e.getCause() instanceof SQLException ) handleSql( (SQLException) e.getCause() ); } Prevention
- Test the MonetDB connection in the step dialog before running the transformation
- Grant the DB user explicit DDL (DROP) privileges on the target schema
- Use fully-qualified schema.table names everywhere
- Keep mserver reachable: monitor the server and pin host/port in the connection
When it happens
Trigger: autoAdjustSchema() calls drop() to remove the target table before recreation; any exception from executeSql("drop table " + data.schemaTable) - connection failure, authentication failure, insufficient privileges, or table/schema not existing in a state where drop fails - triggers this throw.
Common situations: Wrong host/port/credentials in the MonetDB connection definition; the MonetDB server (mserver) is down; the DB user lacks DROP privilege on the schema; the schema or table name encoded in data.schemaTable does not match what exists on the server.
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
- Error while creating table
- Couldn't execute SQL:
- AddSequence.Exception.ErrorReadingSequence
- An error occurred executing SQL:
- An error occurred writing data to the MonetDB API (MAPI)…
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/99986ca476e3ce05.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoader.java:409
try {
executeSql( cmd );
} catch ( Exception e ) {
throw new KettleException( "Error while truncating table " + table, e );
}
// try to update the metadata registry
util.updateMetadata( meta, -1 );
if ( log.isDetailed() ) {
logDetailed( "Successfull: " + cmd );
}
}
public void drop() throws KettleException {
try {
executeSql( "drop table " + data.schemaTable );
} catch ( Exception e ) {
throw new KettleException( "Error while dropping table " + data.schemaTable, e );
}
}
public void autoAdjustSchema( MonetDBBulkLoaderMeta meta ) throws KettleException {
if ( log.isDetailed() ) {
logDetailed( "Attempting to auto adjust table structure" );
}
drop();
if ( log.isDetailed() ) {
logDetailed( "getTransMeta: " + getTransMeta() );
}
if ( log.isDetailed() ) {
logDetailed( "getStepname: " + getStepname() );
}View on GitHub (pinned to f3058517a1)