{"record":{"id":"b81c11231a712608","repo":"pentaho/pentaho-kettle","slug":"mysqlbulkloadermeta-exception","errorCode":"MySQLBulkLoaderMeta.Exception.UnexpectedErrorReadingStepInfoFromRepository","errorMessage":"MySQLBulkLoaderMeta.Exception.UnexpectedErrorReadingStepInfoFromRepository","messagePattern":"MySQLBulkLoaderMeta\\.Exception\\.UnexpectedErrorReadingStepInfoFromRepository","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":356,"sourceCode":"      replacingData = rep.getStepAttributeBoolean( id_step, \"replace\" );\n      ignoringErrors = rep.getStepAttributeBoolean( id_step, \"ignore\" );\n      localFile = rep.getStepAttributeBoolean( id_step, \"local\" );\n      bulkSize = rep.getStepAttributeString( id_step, \"bulk_size\" );\n\n      int nrvalues = rep.countNrStepAttributes( id_step, \"stream_name\" );\n\n      allocate( nrvalues );\n\n      for ( int i = 0; i < nrvalues; i++ ) {\n        fieldTable[i] = rep.getStepAttributeString( id_step, i, \"stream_name\" );\n        fieldStream[i] = rep.getStepAttributeString( id_step, i, \"field_name\" );\n        if ( fieldStream[i] == null ) {\n          fieldStream[i] = fieldTable[i];\n        }\n        fieldFormatType[i] = getFieldFormatType( rep.getStepAttributeString( id_step, i, \"field_format_ok\" ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG,\n          \"MySQLBulkLoaderMeta.Exception.UnexpectedErrorReadingStepInfoFromRepository\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )\n    throws KettleException {\n    try {\n      rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, \"id_connection\", databaseMeta );\n      rep.saveStepAttribute( id_transformation, id_step, \"schema\", schemaName );\n      rep.saveStepAttribute( id_transformation, id_step, \"table\", tableName );\n      rep.saveStepAttribute( id_transformation, id_step, \"encoding\", encoding );\n      rep.saveStepAttribute( id_transformation, id_step, \"enclosure\", enclosure );\n      rep.saveStepAttribute( id_transformation, id_step, \"delimiter\", delimiter );\n      rep.saveStepAttribute( id_transformation, id_step, \"escape_char\", escapeChar );\n      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 );","sourceCodeStart":338,"sourceCodeEnd":374,"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#L338-L374","documentation":"readRep loads the step's settings from a repository and wraps any failure in a KettleException with the UnexpectedErrorReadingStepInfoFromRepository message. It means reading the MySQL Bulk Loader's attributes from the repository database failed — bad attribute data, a repository access error, or an unrecognized stored value. The cause carries the underlying error.","triggerScenarios":"readRep (called when a transformation is loaded from a repository) throws when rep.getStepAttributeString or attribute-count queries fail, getFieldFormatType cannot interpret a stored field_format_ok value, or any other exception occurs while iterating stored field rows.","commonSituations":"Corrupted or partially deleted repository rows for the step; repository schema version mismatch (older/newer PDI repository format); stored format-type string no longer recognized after an upgrade; repository connectivity problems during load.","solutions":["Check the KettleException cause (getCause()) to see whether it is a repository access error or a bad attribute value.","Re-save the step from Spoon to rewrite its repository attributes in the current format.","Verify the repository connection and that the PDI repository schema matches your Kettle version (run the repository upgrade if needed).","If only one transformation is affected, recreate the MySQL Bulk Loader step and re-save to replace the corrupted attributes."],"exampleFix":"// before: manual repository edits leave an unparseable attribute\nUPDATE r_step_attribute SET value_str = 'bogus' WHERE code = 'field_format_ok';\n// after: fix via the supported path — re-save the step in Spoon, or restore a valid value\nUPDATE r_step_attribute SET value_str = 'none' WHERE code = 'field_format_ok';","handlingStrategy":"try-catch","validationCode":"// Before loading from repository, verify the repository is reachable\nrepository.connect( user, pass );\nif ( repository.findStep( transformationObjectId, \"bulk loader\" ) == null ) {\n  throw new IllegalStateException( \"Bulk loader step missing from repository\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta = new TransMeta( repository, transformationPath, null );\n} catch ( KettleException e ) {\n  if ( String.valueOf( e.getMessage() ).contains( \"UnexpectedErrorReadingStepInfo\" ) ) {\n    log.error( \"Repository read of bulk loader step failed; cause:\", e.getCause() );\n    // fallback: load the same transformation from a .ktr export\n    transMeta = new TransMeta( backupKtrPath );\n  } else {\n    throw e;\n  }\n}","preventionTips":["Keep the repository schema upgraded to match your PDI version.","Back up transformations as .ktr exports so corrupted repository entries can be restored.","Avoid direct SQL edits to r_step_attribute rows.","Test repository connectivity before automated loads."],"tags":["repository","metadata","persistence"],"backgroundTag":"database-query-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"}