{"record":{"id":"bc76a77a344d9f99","repo":"pentaho/pentaho-kettle","slug":"mysqlbulkloadermeta-exception-bc76a7","errorCode":"MySQLBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository","errorMessage":"MySQLBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository","messagePattern":"MySQLBulkLoaderMeta\\.Exception\\.UnableToSaveStepInfoToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mysql-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/mysqlbulkloader/MySQLBulkLoaderMeta.java","lineNumber":389,"sourceCode":"      rep.saveStepAttribute( id_transformation, id_step, \"fifo_file_name\", fifoFileName );\n      rep.saveStepAttribute( id_transformation, id_step, \"replace\", replacingData );\n      rep.saveStepAttribute( id_transformation, id_step, \"ignore\", ignoringErrors );\n      rep.saveStepAttribute( id_transformation, id_step, \"local\", localFile );\n      rep.saveStepAttribute( id_transformation, id_step, \"bulk_size\", bulkSize );\n\n      for ( int i = 0; i < fieldTable.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"stream_name\", fieldTable[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", fieldStream[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_format_ok\",\n            getFieldFormatTypeCode( fieldFormatType[i] ) );\n      }\n\n      // Also, save the step-database relationship!\n      if ( databaseMeta != null ) {\n        rep.insertStepDatabase( id_transformation, id_step, databaseMeta.getObjectId() );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG,\n          \"MySQLBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository\" )\n          + id_step, e );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,\n      VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    // Default: nothing changes to rowMeta\n  }\n\n  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,\n      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,\n      IMetaStore metaStore ) {\n    CheckResult cr;\n    String error_message = \"\";\n\n    if ( databaseMeta != null ) {","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mysql-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/mysqlbulkloader/MySQLBulkLoaderMeta.java#L371-L407","documentation":"saveRep persists the step's settings to a repository and wraps any failure in a KettleException with UnableToSaveStepInfoToRepository (with id_step appended to the message). It means writing the MySQL Bulk Loader's attributes — field mappings, the step-database relation via insertStepDatabase, etc. — to the repository failed. The underlying cause is attached.","triggerScenarios":"saveRep (called when saving a transformation to a repository) throws when rep.saveStepAttribute or rep.insertStepDatabase fail — repository connection loss, insufficient privileges, a constraint violation, or any other exception while writing step attributes.","commonSituations":"Repository database down or network dropped mid-save; user lacks INSERT/UPDATE privileges on repository tables; duplicate key from a partially completed previous save; repository storage full or read-only.","solutions":["Check the KettleException cause (getCause()) for the JDBC error — connectivity, permissions, or constraint violation — and address that first.","Verify repository database connectivity and retry the save once the repository is reachable.","Confirm the user has write privileges (INSERT/UPDATE on r_step_attribute and related tables) in the repository.","If a partial save left orphaned rows, clean them up and save again."],"exampleFix":"// before: saving with a read-only repository user\nrepoUser = \"reader\";\n// after: use a user with write privileges on the repository schema\nrepoUser = \"pdi_admin\";\nrepository.connect( repoUser, repoPassword );\ntransformation.saveRep( repository );","handlingStrategy":"try-catch","validationCode":"// Before saving, verify repository connectivity\nif ( !repository.isConnected() ) {\n  throw new IllegalStateException( \"Repository not connected; cannot save transformation.\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta.saveRep( repository, null, null );\n} catch ( KettleException e ) {\n  if ( String.valueOf( e.getMessage() ).contains( \"UnableToSaveStepInfo\" ) ) {\n    log.error( \"Repository save failed for step; cause:\", e.getCause() );\n    // fallback: persist to a local .ktr so work is not lost\n    transMeta.saveXML( backupKtrPath );\n  } else {\n    throw e;\n  }\n}","preventionTips":["Confirm the repository user has INSERT/UPDATE privileges before saving.","Save a local .ktr copy alongside repository saves as a fallback.","Monitor repository DB health (disk space, connections) before metadata operations.","Retry the save on transient connectivity errors."],"tags":["repository","persistence","database-write"],"backgroundTag":"database-write-failed","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"}