{"record":{"id":"eec418610ec3e685","repo":"pentaho/pentaho-kettle","slug":"fileexistsmeta-exception-unabletosavestepinfo","errorCode":null,"errorMessage":"FileExistsMeta.Exception.UnableToSaveStepInfo","messagePattern":"FileExistsMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExistsMeta.java","lineNumber":213,"sourceCode":"      resultfieldname = rep.getStepAttributeString( id_step, \"resultfieldname\" );\n      includefiletype = rep.getStepAttributeBoolean( id_step, \"includefiletype\" );\n      filetypefieldname = rep.getStepAttributeString( id_step, \"filetypefieldname\" );\n      addresultfilenames = rep.getStepAttributeBoolean( id_step, \"addresultfilenames\" );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"FileExistsMeta.Exception.UnexpectedErrorReadingStepInfo\" ), e );\n    }\n  }\n\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, \"filenamefield\", filenamefield );\n      rep.saveStepAttribute( id_transformation, id_step, \"resultfieldname\", resultfieldname );\n      rep.saveStepAttribute( id_transformation, id_step, \"includefiletype\", includefiletype );\n      rep.saveStepAttribute( id_transformation, id_step, \"filetypefieldname\", filetypefieldname );\n      rep.saveStepAttribute( id_transformation, id_step, \"addresultfilenames\", addresultfilenames );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"FileExistsMeta.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    String error_message = \"\";\n\n    if ( Utils.isEmpty( resultfieldname ) ) {\n      error_message = BaseMessages.getString( PKG, \"FileExistsMeta.CheckResult.ResultFieldMissing\" );\n      cr = new CheckResult( CheckResult.TYPE_RESULT_ERROR, error_message, stepMeta );\n      remarks.add( cr );\n    } else {\n      error_message = BaseMessages.getString( PKG, \"FileExistsMeta.CheckResult.ResultFieldOK\" );\n      cr = new CheckResult( CheckResult.TYPE_RESULT_OK, error_message, stepMeta );\n      remarks.add( cr );","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExistsMeta.java#L195-L231","documentation":"FileExistsMeta.saveRep() writes the step attributes (filenamefield, resultfieldname, includefiletype, filetypefieldname, addresultfilenames) to the Kettle repository and wraps any failure in a KettleException with 'UnableToSaveStepInfo' plus the step id. It means the step's settings could not be persisted.","triggerScenarios":"Saving a transformation to a repository when an INSERT/UPDATE into r_step_attribute fails: DB connection lost, read-only account, constraint violation, or disk full on the DB server.","commonSituations":"Repository user lacking write privileges; database in read-only mode; connection dropped during save; repository schema mismatch after upgrade.","solutions":["Check the repository database is reachable and writable; retry the save.","Grant the repository user INSERT/UPDATE rights on the repository tables.","Upgrade/repair the repository schema if it mismatches the current Pentaho version.","Save the transformation to a .ktr file as a workaround while fixing the repository."],"exampleFix":"// before\n// save with read-only repo user -> saveRep throws\n// after\nGRANT INSERT, UPDATE ON r_step_attribute TO kettle_user; // then retry save","handlingStrategy":"try-catch","validationCode":"if (rep.getConnection().isReadOnly()) {\n  throw new IllegalStateException(\"Repository connection is read-only; saving will fail\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta.saveRep(rep, metaStore, null, null);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"FileExistsMeta.Exception.UnableToSaveStepInfo\")) {\n    // check DB grants/connectivity; retry or save to file\n  } else { throw e; }\n}","preventionTips":["Grant the repository user INSERT/UPDATE/DELETE on repository tables.","Monitor DB disk space and connection health before bulk saves.","Commit changes only after successful save; keep local ktr backups.","Upgrade the repository schema before saving from a newer client."],"tags":["repository","database","metadata","save"],"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"}