{"record":{"id":"3a889e0a889352ef","repo":"pentaho/pentaho-kettle","slug":"error-while-exporting-repository-transformations","errorCode":null,"errorMessage":"Error while exporting repository transformations","messagePattern":"Error while exporting repository transformations","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/RepositoryExporter.java","lineNumber":486,"sourceCode":"            monitor.registerRuleViolation();\n            writer.registerRuleViolation();\n          }\n          // do we need any feedback on this action?\n          if ( feedback ) {\n            ExportFeedback fb = new ExportFeedback();\n            fb.setType( ExportFeedback.Type.TRANSFORMATION );\n            fb.setItemName( transMeta.getName() );\n            fb.setItemPath( dirPath );\n            ExportFeedback.Status status =\n                errors.isEmpty() ? ExportFeedback.Status.EXPORTED : ExportFeedback.Status.REJECTED;\n            fb.setStatus( status );\n            fb.setResult( errors );\n            this.feedbackList.add( fb );\n          }\n        }\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Error while exporting repository transformations\", e );\n    } finally {\n      writer.closeTrans();\n    }\n  }\n\n  private class ExportWriter implements IExportWriter {\n\n    private IExportWriter delegate;\n    private FileObject writeTo;\n\n    private boolean fileDeleted = false;\n\n    ExportWriter( FileObject writeTo ) throws KettleException {\n      this.writeTo = writeTo;\n      this.delegate = new ExportStFileWriter( writeTo );\n    }\n\n    void registerRuleViolation() throws IOException {","sourceCodeStart":468,"sourceCodeEnd":504,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/RepositoryExporter.java#L468-L504","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the cause chain to identify the failing transformation; export subdirectories individually to isolate it.","Install the missing step/plugin jars referenced by the transformation, then retry.","Repair or remove the damaged transformation in the repository database.","Verify repository database connection stability and user read permissions.","Re-run the export after fixes; regenerate the output file from the successful run."],"exampleFix":"// before\nexporter.exportAllObjects(monitor, \"all.xml\", null, RepositoryExportType.ALL); // fails mid-transformations\n// after: isolate failures per directory with feedback\nexporter.exportAllObjectsWithFeedback(monitor, \"all.xml\", null, RepositoryExportType.ALL, feedback -> {\n  if (feedback.getResult() != null) log.warn(\"Transformation export issue: \" + feedback.getResult());\n});","handlingStrategy":"try-catch","validationCode":"repository.test(); // ensure repository DB reachable before exporting transformations","typeGuard":null,"tryCatchPattern":"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); }","preventionTips":["Verify all step plugins used by transformations are installed","Use exportAllObjectsWithFeedback to observe per-item failures","Validate transformation metadata in the repository after upgrades","Ensure stable DB connectivity for long exports"],"tags":["export","repository","transformations","pdi"],"backgroundTag":"api-request-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"}