pentaho/pentaho-kettle · error · KettleException

Error while exporting repository transformations

Error message

Error while exporting repository transformations

What it means

RepositoryExporter.exportTransformations mirrors exportJobs for transformations: any exception while loading or serializing transformations from the repository is wrapped in a KettleException "Error while exporting repository transformations", with writer.closeTrans() in finally and the original exception as cause.

Solutions

  1. Read the cause chain to identify the failing transformation; export subdirectories individually to isolate it.
  2. Install the missing step/plugin jars referenced by the transformation, then retry.
  3. Repair or remove the damaged transformation in the repository database.
  4. Verify repository database connection stability and user read permissions.
  5. Re-run the export after fixes; regenerate the output file from the successful run.

Example fix

// before
exporter.exportAllObjects(monitor, "all.xml", null, RepositoryExportType.ALL); // fails mid-transformations
// after: isolate failures per directory with feedback
exporter.exportAllObjectsWithFeedback(monitor, "all.xml", null, RepositoryExportType.ALL, feedback -> {
  if (feedback.getResult() != null) log.warn("Transformation export issue: " + feedback.getResult());
});
Defensive patterns

Strategy: try-catch

Validate before calling

repository.test(); // ensure repository DB reachable before exporting transformations

Try / catch

try { exporter.exportAllObjects(monitor, file, null, RepositoryExportType.ALL); } catch (KettleException e) { Throwable cause = e; while (cause.getCause() != null) cause = cause.getCause(); log.error("Transformation export failed; root cause: " + cause, e); }

Prevention

When it happens

Trigger: exportAllObjects/exportAllObjectsWithFeedback including transformations, when a transformation fails to load from the repository (corrupt metadata, missing plugin/step, DB error) or its XML export serialization throws.

Common situations: Transformations using steps from plugins not installed in the exporting instance; damaged rows in the repository tables; repository connectivity failures mid-export; directories unreadable by the current user.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/RepositoryExporter.java:486

            monitor.registerRuleViolation();
            writer.registerRuleViolation();
          }
          // do we need any feedback on this action?
          if ( feedback ) {
            ExportFeedback fb = new ExportFeedback();
            fb.setType( ExportFeedback.Type.TRANSFORMATION );
            fb.setItemName( transMeta.getName() );
            fb.setItemPath( dirPath );
            ExportFeedback.Status status =
                errors.isEmpty() ? ExportFeedback.Status.EXPORTED : ExportFeedback.Status.REJECTED;
            fb.setStatus( status );
            fb.setResult( errors );
            this.feedbackList.add( fb );
          }
        }
      }
    } catch ( Exception e ) {
      throw new KettleException( "Error while exporting repository transformations", e );
    } finally {
      writer.closeTrans();
    }
  }

  private class ExportWriter implements IExportWriter {

    private IExportWriter delegate;
    private FileObject writeTo;

    private boolean fileDeleted = false;

    ExportWriter( FileObject writeTo ) throws KettleException {
      this.writeTo = writeTo;
      this.delegate = new ExportStFileWriter( writeTo );
    }

    void registerRuleViolation() throws IOException {

View on GitHub (pinned to f3058517a1)