{"record":{"id":"7b7540a750f69e17","repo":"pentaho/pentaho-kettle","slug":"jsoninputmeta-exception-errorsavingtorepository","errorCode":"JsonInputMeta.Exception.ErrorSavingToRepository","errorMessage":"JsonInputMeta.Exception.ErrorSavingToRepository","messagePattern":"JsonInputMeta\\.Exception\\.ErrorSavingToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInputMeta.java","lineNumber":995,"sourceCode":"        rep.saveStepAttribute( id_transformation, id_step, i, \"field_precision\", field.getPrecision() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_trim_type\", field.getTrimTypeCode() );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_repeat\", field.isRepeated() );\n      }\n      rep.saveStepAttribute( id_transformation, id_step, \"IsInFields\", inFields );\n      rep.saveStepAttribute( id_transformation, id_step, \"IsAFile\", isAFile );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"valueField\", valueField );\n      rep.saveStepAttribute( id_transformation, id_step, \"shortFileFieldName\", getShortFileNameField() );\n      rep.saveStepAttribute( id_transformation, id_step, \"pathFieldName\", getPathField() );\n      rep.saveStepAttribute( id_transformation, id_step, \"hiddenFieldName\", isHiddenField() );\n      rep.saveStepAttribute(\n        id_transformation, id_step, \"lastModificationTimeFieldName\", getLastModificationDateField() );\n      rep.saveStepAttribute( id_transformation, id_step, \"uriNameFieldName\", getUriField() );\n      rep.saveStepAttribute( id_transformation, id_step, \"rootUriNameFieldName\", getRootUriField() );\n      rep.saveStepAttribute( id_transformation, id_step, \"extensionFieldName\", getExtensionField() );\n      rep.saveStepAttribute( id_transformation, id_step, \"sizeFieldName\", getSizeField() );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JsonInputMeta.Exception.ErrorSavingToRepository\", \"\" + id_step ), e );\n    }\n  }\n\n  public FileInputList getFiles( Bowl bowl, VariableSpace space ) {\n    return FileInputList.createFileList(\n      bowl, space, getFileName(), getFileMask(), getExcludeFileMask(), getFileRequired(),\n      inputFiles.includeSubFolderBoolean() );\n  }\n\n  @Override\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\n    if ( !isInFields() ) {\n      // See if we get input...","sourceCodeStart":977,"sourceCodeEnd":1013,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInputMeta.java#L977-L1013","documentation":"KettleException with message key JsonInputMeta.Exception.ErrorSavingToRepository (including the id_step), thrown by JsonInputMeta.saveRep when persisting the step's attributes to the repository fails. Any exception from the rep.saveStepAttribute calls (DB error, constraint violation, connection loss) is wrapped here.","triggerScenarios":"saveRep loop of rep.saveStepAttribute(...) throws: repository DB unavailable, transaction/lock conflict, value too long for the attribute column, or read-only repository connection.","commonSituations":"Saving a transformation while the repository database is down or network is flaky; two users saving the same transformation concurrently; repository user lacking write permissions; attribute values exceeding column size limits.","solutions":["Check the wrapped cause: fix repository DB connectivity or the reported DB error and retry the save.","Verify the repository user has INSERT/UPDATE rights on R_STEP_ATTRIBUTE.","Reconnect to the repository (right-click -> reconnect) if the session was stale, then save again.","Coordinate with other users to avoid concurrent saves of the same transformation (version/lock the object)."],"exampleFix":"// before\nrep.save(new RepositoryDirectory(), transName, transMeta, monitor); // fails when DB down\n// after\nif (!rep.isConnected()) rep.connect();\nrep.save(dir, transName, transMeta, monitor);","handlingStrategy":"retry","validationCode":"// confirm write access before saving\nif (!rep.testConnectionSuccess()) throw new IllegalStateException(\"Repository unreachable\");\n// and confirm user has save rights on the directory in your repository security model","typeGuard":null,"tryCatchPattern":"try { rep.save(dir, name, transMeta, monitor); }\ncatch (KettleException e) {\n  if (getRootCause(e) instanceof SQLException && isTransient(e)) { retrySaveWithBackoff(); }\n  else throw e;\n}","preventionTips":["Save through a stable repository connection; reconnect after long idle sessions.","Grant the repository user INSERT/UPDATE on R_STEP_ATTRIBUTE.","Coordinate concurrent edits (one editor per transformation) to avoid lock conflicts.","Keep attribute values within repository column size limits."],"tags":["repository","database","metadata-persistence","kettle"],"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"}