{"record":{"id":"b3109d3998cfb2c2","repo":"pentaho/pentaho-kettle","slug":"mappinginputmeta-exception-unabletosavestepinfo","errorCode":"MappingInputMeta.Exception.UnableToSaveStepInfo","errorMessage":"MappingInputMeta.Exception.UnableToSaveStepInfo","messagePattern":"MappingInputMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/mappinginput/MappingInputMeta.java","lineNumber":374,"sourceCode":"  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )\n    throws KettleException {\n    try {\n      for ( int i = 0; i < fieldName.length; i++ ) {\n        if ( fieldName[ i ] != null && fieldName[ i ].length() != 0 ) {\n          rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", fieldName[ i ] );\n          rep.saveStepAttribute( id_transformation, id_step, i, \"field_type\",\n            ValueMetaFactory.getValueMetaName( fieldType[ i ] ) );\n          rep.saveStepAttribute( id_transformation, id_step, i, \"field_length\", fieldLength[ i ] );\n          rep.saveStepAttribute( id_transformation, id_step, i, \"field_precision\", fieldPrecision[ i ] );\n        }\n      }\n\n      rep.saveStepAttribute(\n        id_transformation, id_step, \"select_unspecified\", selectingAndSortingUnspecifiedFields );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"MappingInputMeta.Exception.UnableToSaveStepInfo\" )\n        + id_step, e );\n    }\n  }\n\n  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,\n                     RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,\n                     Repository repository, IMetaStore metaStore ) {\n    CheckResult cr;\n    if ( prev == null || prev.size() == 0 ) {\n      cr =\n        new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(\n          PKG, \"MappingInputMeta.CheckResult.NotReceivingFieldsError\" ), stepMeta );\n      remarks.add( cr );\n    } else {\n      cr =\n        new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(\n          PKG, \"MappingInputMeta.CheckResult.StepReceivingDatasFromPreviousOne\", prev.size() + \"\" ), stepMeta );\n      remarks.add( cr );","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mappinginput/MappingInputMeta.java#L356-L392","documentation":"MappingInputMeta.saveRep() wraps any exception raised while persisting the step's attributes (field definitions and the select_unspecified flag) to the repository, rethrowing as a KettleException with this message key. It means the step's configuration could not be saved and the transformation in the repository is incomplete or not updated. The cause holds the real repository error.","triggerScenarios":"Calling saveRep() when Repository.saveStepAttribute(...) throws — repository connection lost, database in read-only mode, constraint violation, or a null/unexpected attribute value.","commonSituations":"Saving a transformation while the repository DB went down or the session expired; read-only database credentials; repository disk quota/table permission problems; concurrent edits locking the step metadata.","solutions":["Check the cause exception for the repository/database error (connection, permissions, constraints) and fix it.","Reconnect to the repository and retry saving the transformation.","Verify the repository user has INSERT/UPDATE rights on R_STEP_ATTRIBUTE.","If the repository is read-only (e.g. a shared prod repo), save the transformation to a local file instead."],"exampleFix":"// before: blind save\nmeta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());\n\n// after: check write access first\nif (!repository.getConnection().isReadOnly()) {\n  meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());\n} else {\n  throw new KettleException(\"Repository is read-only; save aborted\");\n}","handlingStrategy":"try-catch","validationCode":"if (repository.isReadOnly()) {\n  throw new IllegalStateException(\"Repository is read-only; cannot save MappingInput step\");\n}\nif (!repository.isConnected()) {\n  repository.connect(user, password);\n}","typeGuard":"boolean isSavable(Repository rep) {\n  return rep != null && rep.isConnected() && !rep.isReadOnly();\n}","tryCatchPattern":"try {\n  meta.saveRep(repository, metastore, transMeta.getObjectId(), stepMeta.getObjectId());\n} catch (KettleException e) {\n  logError(\"MappingInput metadata save failed: \" + e.getCause(), e);\n  throw e;\n}","preventionTips":["Confirm DB credentials have INSERT/UPDATE rights on repository tables.","Reconnect after long idle periods before saving.","Avoid saving to shared read-only production repositories.","Always inspect the chained cause to distinguish connection vs permission vs constraint errors."],"tags":["kettle","repository","step-metadata","persistence"],"backgroundTag":"file-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"}