{"record":{"id":"fbb32bf33049525a","repo":"pentaho/pentaho-kettle","slug":"processfilesmeta-exception-unabletosavestepinfo","errorCode":null,"errorMessage":"ProcessFilesMeta.Exception.UnableToSaveStepInfo","messagePattern":"ProcessFilesMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/processfiles/ProcessFilesMeta.java","lineNumber":299,"sourceCode":"    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"ProcessFilesMeta.Exception.UnexpectedErrorReadingStepInfo\" ), e );\n    }\n  }\n\n  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"sourcefilenamefield\", sourcefilenamefield );\n      rep.saveStepAttribute( id_transformation, id_step, \"targetfilenamefield\", targetfilenamefield );\n      rep.saveStepAttribute( id_transformation, id_step, \"operation_type\", getOperationTypeCode( operationType ) );\n      rep.saveStepAttribute( id_transformation, id_step, \"addresultfilenames\", addresultfilenames );\n      rep.saveStepAttribute( id_transformation, id_step, \"overwritetargetfile\", overwritetargetfile );\n      rep.saveStepAttribute( id_transformation, id_step, \"createparentfolder\", createparentfolder );\n      rep.saveStepAttribute( id_transformation, id_step, \"simulate\", simulate );\n\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"ProcessFilesMeta.Exception.UnableToSaveStepInfo\" )\n        + id_step, e );\n    }\n  }\n\n  @Override\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    String error_message = \"\";\n\n    // source filename\n    if ( Utils.isEmpty( sourcefilenamefield ) ) {\n      error_message = BaseMessages.getString( PKG, \"ProcessFilesMeta.CheckResult.SourceFileFieldMissing\" );\n      cr = new CheckResult( CheckResult.TYPE_RESULT_ERROR, error_message, stepMeta );\n      remarks.add( cr );\n    } else {\n      error_message = BaseMessages.getString( PKG, \"ProcessFilesMeta.CheckResult.TargetFileFieldOK\" );","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/processfiles/ProcessFilesMeta.java#L281-L317","documentation":"ProcessFilesMeta.saveRep() wraps any exception raised while persisting this step's attributes (file lists, overwrite/create-parent-folder/simulate flags) to the Kettle repository in a KettleException with this localized message plus the step ID. It means the step metadata could not be saved to the repository, not that the step itself is misconfigured.","triggerScenarios":"Calling saveRep (e.g. via saving a transformation to a database repository) when the underlying repository insert/update of one of the step attributes fails — repository connection loss, schema mismatch, missing tables, or a null/invalid ObjectId.","commonSituations":"Saving a transformation over a flaky or mis-migrated repository database; repository schema missing the r_step_attribute table updates; permission problems on the repository DB; stale/closed repository connection mid-save.","solutions":["Check repository database connectivity and retry the save","Verify the repository schema is up to date (run repository upgrade/repair tools)","Confirm the user has write permissions on the repository tables","Inspect the wrapped cause (KettleException.getCause()) for the root SQL error","If the repository is unstable, save the transformation as XML/file instead"],"exampleFix":"// before\ntransMeta.saveRep(repo, metaStore, transMeta.getObjectId(), null);\n// after\nif (repo != null && transMeta.getObjectId() != null) {\n  try {\n    transMeta.saveRep(repo, metaStore, transMeta.getObjectId(), null);\n  } catch (KettleException e) {\n    logError(\"Step info save failed: \" + e.getCause());\n    throw e;\n  }\n}","handlingStrategy":"try-catch","validationCode":"if (repo == null || transMeta.getObjectId() == null) throw new IllegalStateException(\"Repository not connected\");\n// also verify connectivity:\nrepo.connect();","typeGuard":"boolean canSave = repo != null && repo.isConnected() && transMeta.getObjectId() != null;","tryCatchPattern":"try {\n  stepMeta.getStepMetaInterface().saveRep(repo, metaStore, idTrans, idStep);\n} catch (KettleException e) {\n  logError(\"Save failed for step \" + idStep + \": \" + e.getCause(), e);\n  // retry or fall back to XML export\n}","preventionTips":["Keep repository connections healthy; reconnect before long save operations","Run repository schema upgrades after every PDI version change","Ensure the saving user has write permissions on repository tables","Periodically export transformations to XML as a backup"],"tags":["kettle","repository","persistence","metadata"],"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"}