pentaho/pentaho-kettle · error · KettleException

GetXMLDataMeta.Exception.ErrorSavingToRepository (localized…

Error message

GetXMLDataMeta.Exception.ErrorSavingToRepository (localized message with id_step)

What it means

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.

Solutions

  1. Check the id_step in the message against repository logs / database errors for the concrete SQL failure.
  2. Reconnect to the repository in Spoon and re-save the transformation.
  3. Verify the user has INSERT/UPDATE rights on the repository tables (R_STEP_ATTRIBUTE etc.).
  4. If the repository is read-only (e.g. shared/production), export the transformation to a .ktr file instead.

Example fix

// before: silent assumption of writable repository
rep.saveStepAttribute( id_transformation, id_step, "filename", fileName );
// after: check writability and handle
try ( Repository rep = connectReadOnlyCheck() ) { rep.saveStepAttribute( id_transformation, id_step, "filename", fileName ); }
catch ( KettleException e ) { logError( "Repository read-only? Falling back to file export", e ); }
Defensive patterns

Strategy: try-catch

Validate before calling

// Check the repository user can write before saving
// e.g. SELECT on privileges or attempt a harmless save of a temp transformation first

Try / catch

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" ); }

Prevention

When it happens

Trigger: The saveRep(...) catch block: any rep.saveStepAttribute call fails - repository connection error, database constraint violation, read-only repository, or oversized attribute values.

Common situations: 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.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/e79c72af31d7fc39. Report an issue: GitHub.

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLDataMeta.java:1155

        rep.saveStepAttribute( id_transformation, id_step, i, TAG_FIELD_PRECISION, field.getPrecision() );
        rep.saveStepAttribute( id_transformation, id_step, i, TAG_FIELD_TRIM_TYPE, field.getTrimTypeCode() );
        rep.saveStepAttribute( id_transformation, id_step, i, TAG_FIELD_REPEAT, field.isRepeated() );
      }
      rep.saveStepAttribute( id_transformation, id_step, TAG_IS_IN_FIELDS, inFields );
      rep.saveStepAttribute( id_transformation, id_step, TAG_IS_A_FILE, IsAFile );

      rep.saveStepAttribute( id_transformation, id_step, TAG_XML_FIELD, xmlField );
      rep.saveStepAttribute( id_transformation, id_step, TAG_PRUNE_PATH, prunePath );
      rep.saveStepAttribute( id_transformation, id_step, TAG_SHORT_FILE_FIELD_NAME, shortFileFieldName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_EXTENSION_FIELD_NAME, extensionFieldName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_PATH_FIELD_NAME, pathFieldName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_SIZE_FIELD_NAME, sizeFieldName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_HIDDEN_FIELD_NAME, hiddenFieldName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_LAST_MODIFICATION_TIME_FIELD_NAME, lastModificationTimeFieldName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_URI_NAME_FIELD_NAME, uriNameFieldName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_ROOT_URI_NAME_FIELD_NAME, rootUriNameFieldName );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "GetXMLDataMeta.Exception.ErrorSavingToRepository", ""
          + id_step ), e );
    }
  }

  public FileInputList getFiles( Bowl bowl, VariableSpace space ) {
    return FileInputList.createFileList( bowl, space, fileName, fileMask, excludeFileMask, fileRequired,
        includeSubFolderBoolean() );
  }

  private boolean[] includeSubFolderBoolean() {
    int len = fileName.length;
    boolean[] includeSubFolderBoolean = new boolean[len];
    for ( int i = 0; i < len; i++ ) {
      includeSubFolderBoolean[i] = YES.equalsIgnoreCase( includeSubFolders[i] );
    }
    return includeSubFolderBoolean;
  }

View on GitHub (pinned to f3058517a1)