{"record":{"id":"a42bcf51dd9b1f02","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-in-combination-insert-in-part-debug-e","errorCode":null,"errorMessage":"Unexpected error in combination insert in part [ + debug + ] :  + e.toString()","messagePattern":"Unexpected error in combination insert in part \\[ \\+ debug \\+ \\] :  \\+ e\\.toString\\(\\)","errorType":"exception","errorClass":"KettleDatabaseException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/combinationlookup/CombinationLookup.java","lineNumber":649,"sourceCode":"              + meta.getTechnicalKeyField() + \", no fields in resultset\" );\n          }\n        } catch ( SQLException ex ) {\n          throw new KettleDatabaseException( \"Unable to retrieve auto-increment of combi insert key : \"\n            + meta.getTechnicalKeyField(), ex );\n        } finally {\n          try {\n            if ( keys != null ) {\n              keys.close();\n            }\n          } catch ( SQLException ex ) {\n            throw new KettleDatabaseException( \"Unable to retrieve auto-increment of combi insert key : \"\n              + meta.getTechnicalKeyField(), ex );\n          }\n        }\n      }\n    } catch ( Exception e ) {\n      logError( Const.getStackTracker( e ) );\n      throw new KettleDatabaseException( \"Unexpected error in combination insert in part [\"\n        + debug + \"] : \" + e.toString(), e );\n    }\n\n    return val_key;\n  }\n\n  public boolean isRowLevel() {\n    return log.isRowLevel();\n  }\n\n  public boolean init( StepMetaInterface sii, StepDataInterface sdi ) {\n    if ( super.init( sii, sdi ) ) {\n      data.realSchemaName = environmentSubstitute( meta.getSchemaName() );\n      data.realTableName = environmentSubstitute( meta.getTableName() );\n\n      data.cache = meta.getCacheSize() > 0 ? new HashMap<>( (int) ( meta.getCacheSize() * 1.5 ) ) : new HashMap<>();\n\n      data.db.setCommitSize( meta.getCommitSize() );","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/combinationlookup/CombinationLookup.java#L631-L667","documentation":"Generic catch-all KettleDatabaseException in combiInsert: any unexpected Exception not caught by the specific prepare/generated-keys handlers is logged with a stack trace and rethrown as 'Unexpected error in combination insert in part [<debug marker>]'. The debug string identifies which phase of combiInsert failed (e.g. 'Create new insert row rins').","triggerScenarios":"Any runtime exception inside combiInsert outside the narrow SQLException handlers — e.g. NullPointerException building the insert row, class cast issues on field values, database meta inconsistencies — escapes to this final catch.","commonSituations":"Null values or unexpected types in incoming fields; step metadata edited by hand (ktr XML) leaving inconsistent cache/keylookups; bugs triggered by specific data content; memory issues constructing large insert rows.","solutions":["Read the logged stack trace immediately above the message to find the real exception and the debug phase marker.","Open the step dialog and re-verify all field mappings (key fields, hash field, technical key) so metadata is consistent.","Check the input rows for nulls or unexpected data types in the fields used for hashing/lookup.","If reproducible with specific data, isolate the failing row and fix or filter it upstream."],"exampleFix":"// before: incoming field 'birthdate' sometimes null, causing NPE in hash construction\n// after: add a DefaultValue / If Null step upstream\n//        (e.g. replace null birthdate with '1900-01-01') before the CombinationLookup.","handlingStrategy":"try-catch","validationCode":"// validate input rows upstream: null-check and type-check fields used for hashing\n// if (row[i] == null) throw new KettleException(\"Field \" + fieldName + \" must not be null\");","typeGuard":null,"tryCatchPattern":"try { /* run */ } catch (KettleDatabaseException e) {\n  // the debug marker and stack trace are logged before this throw — inspect server log\n  log.error(\"combiInsert failed at phase marker logged above; see stack tracker\");\n}","preventionTips":["Always read the stack trace logged just before this message to find the real cause.","Normalize nulls and data types before the step (DefaultValue steps).","Re-verify step metadata in the UI instead of editing XML.","Test with representative production data including edge cases."],"tags":["database","unexpected-error","kettle","dimension-lookup"],"backgroundTag":"internal-invariant-violation","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}