{"record":{"id":"e79c72af31d7fc39","repo":"pentaho/pentaho-kettle","slug":"getxmldatameta-exception-errorsavingtorepository-localized","errorCode":null,"errorMessage":"GetXMLDataMeta.Exception.ErrorSavingToRepository (localized message with id_step)","messagePattern":"GetXMLDataMeta\\.Exception\\.ErrorSavingToRepository \\(localized message with id_step\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLDataMeta.java","lineNumber":1155,"sourceCode":"        rep.saveStepAttribute( id_transformation, id_step, i, TAG_FIELD_PRECISION, field.getPrecision() );\n        rep.saveStepAttribute( id_transformation, id_step, i, TAG_FIELD_TRIM_TYPE, field.getTrimTypeCode() );\n        rep.saveStepAttribute( id_transformation, id_step, i, TAG_FIELD_REPEAT, field.isRepeated() );\n      }\n      rep.saveStepAttribute( id_transformation, id_step, TAG_IS_IN_FIELDS, inFields );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_IS_A_FILE, IsAFile );\n\n      rep.saveStepAttribute( id_transformation, id_step, TAG_XML_FIELD, xmlField );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_PRUNE_PATH, prunePath );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_SHORT_FILE_FIELD_NAME, shortFileFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_EXTENSION_FIELD_NAME, extensionFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_PATH_FIELD_NAME, pathFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_SIZE_FIELD_NAME, sizeFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_HIDDEN_FIELD_NAME, hiddenFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_LAST_MODIFICATION_TIME_FIELD_NAME, lastModificationTimeFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_URI_NAME_FIELD_NAME, uriNameFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_ROOT_URI_NAME_FIELD_NAME, rootUriNameFieldName );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"GetXMLDataMeta.Exception.ErrorSavingToRepository\", \"\"\n          + id_step ), e );\n    }\n  }\n\n  public FileInputList getFiles( Bowl bowl, VariableSpace space ) {\n    return FileInputList.createFileList( bowl, space, fileName, fileMask, excludeFileMask, fileRequired,\n        includeSubFolderBoolean() );\n  }\n\n  private boolean[] includeSubFolderBoolean() {\n    int len = fileName.length;\n    boolean[] includeSubFolderBoolean = new boolean[len];\n    for ( int i = 0; i < len; i++ ) {\n      includeSubFolderBoolean[i] = YES.equalsIgnoreCase( includeSubFolders[i] );\n    }\n    return includeSubFolderBoolean;\n  }\n","sourceCodeStart":1137,"sourceCodeEnd":1173,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLDataMeta.java#L1137-L1173","documentation":"GetXMLDataMeta.saveRep wraps any exception while persisting step attributes to the repository in a KettleException with localized message 'GetXMLDataMeta.Exception.ErrorSavingToRepository' including the id_step. It means the step's settings could not be saved.","triggerScenarios":"The saveRep(...) catch block: any rep.saveStepAttribute call fails - repository connection error, database constraint violation, read-only repository, or oversized attribute values.","commonSituations":"Saving a transformation while the repository connection dropped, permissions revoked on the repository schema, database in read-only mode, saving from a job running with a closed/disposed repository session.","solutions":["Check the id_step in the message against repository logs / database errors for the concrete SQL failure.","Reconnect to the repository in Spoon and re-save the transformation.","Verify the user has INSERT/UPDATE rights on the repository tables (R_STEP_ATTRIBUTE etc.).","If the repository is read-only (e.g. shared/production), export the transformation to a .ktr file instead."],"exampleFix":"// before: silent assumption of writable repository\nrep.saveStepAttribute( id_transformation, id_step, \"filename\", fileName );\n// after: check writability and handle\ntry ( Repository rep = connectReadOnlyCheck() ) { rep.saveStepAttribute( id_transformation, id_step, \"filename\", fileName ); }\ncatch ( KettleException e ) { logError( \"Repository read-only? Falling back to file export\", e ); }","handlingStrategy":"try-catch","validationCode":"// Check the repository user can write before saving\n// e.g. SELECT on privileges or attempt a harmless save of a temp transformation first","typeGuard":null,"tryCatchPattern":"try { transMeta.saveRep( rep, metaStore, transId, stepId ); } catch ( KettleException e ) { log.error( \"Save failed for step \" + stepId + \", exporting to file instead\", e ); transMeta.exportToFile( \"fallback.ktr\" ); }","preventionTips":["Grant the runtime user INSERT/UPDATE on repository tables.","Confirm the repository session is open and not read-only before saving.","Keep .ktr file exports as a fallback for shared/read-only repositories."],"tags":["pentaho-kettle","repository","database","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"}