{"record":{"id":"c82358aec5158883","repo":"pentaho/pentaho-kettle","slug":"unsupported-export-type","errorCode":null,"errorMessage":"Unsupported export type: ...","messagePattern":"Unsupported export type: \\.\\.\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/RepositoryExporter.java","lineNumber":187,"sourceCode":"          exportTransformations( monitor, root, writer, feedback );\n          monitor.worked( 50 );\n          exportJobs( monitor, root, writer, feedback );\n          monitor.worked( 50 );\n          break;\n        }\n        case TRANS: {\n          exportTransformations( monitor, root, writer, feedback );\n          monitor.worked( 100 );\n          break;\n        }\n        case JOBS: {\n          exportJobs( monitor, root, writer, feedback );\n          monitor.worked( 100 );\n          break;\n        }\n        default: {\n          // this will never happens\n          throw new KettleException( \"Unsupported export type: \" + type );\n        }\n      }\n      monitor.subTask( BaseMessages.getString( PKG, \"Repository.Exporter.Monitor.SavingResultFile\" ) );\n    } finally {\n      try {\n        if ( writer != null ) {\n          writer.close();\n        }\n      } catch ( Exception e ) {\n        log.logDebug( BaseMessages.getString( PKG, \"Repository.Exporter.Exception.CloseExportFile\", xmlFilename ) );\n      }\n    }\n    if ( monitor != null ) {\n      monitor.done();\n    }\n    return this.feedbackList;\n  }\n","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/RepositoryExporter.java#L169-L205","documentation":"RepositoryExporter.exportAllObjectsInternal switches on the requested RepositoryExportType; the default branch throws a KettleException \"Unsupported export type: <type>\". The comment notes \"this will never happen\" — it guards against the enum having a case not handled by the switch (e.g. a new export type added without updating the exporter).","triggerScenarios":"Calling exportAllObjects/exportAllObjectsWithFeedback with an ExportType value other than the handled ones (ALL, transformations-only, jobs-only branches) — typically a newly introduced enum constant or a null/foreign value.","commonSituations":"Custom code passing an unusual/extended export type; upgrading Pentaho where new export types exist but old exporter logic is in play; passing null and it falling through to default.","solutions":["Log/inspect the exact type value in the message and use one of the supported export types.","Update the switch in exportAllObjectsInternal to handle the new RepositoryExportType constant.","If passing null, pass an explicit supported export type instead.","Check for a version mismatch between code constructing the export type and the exporter implementation."],"exampleFix":"// before: passing an unhandled type\nexporter.exportAllObjects(monitor, \"export.xml\", null, someNewType);\n// after: use a supported type\nexporter.exportAllObjects(monitor, \"export.xml\", null, RepositoryExportType.ALL);","handlingStrategy":"type-guard","validationCode":"EnumSet<RepositoryExportType> supported = EnumSet.of(RepositoryExportType.ALL /* + other handled types */);\nif (type == null || !supported.contains(type)) throw new IllegalArgumentException(\"Unsupported export type: \" + type);","typeGuard":"static boolean isSupportedExportType(RepositoryExportType t) { return t != null && t != RepositoryExportType.valueOf-less-new-constants; } // implement via switch matching handled cases","tryCatchPattern":"try { exporter.exportAllObjects(monitor, file, dir, type); } catch (KettleException e) { if (e.getMessage().startsWith(\"Unsupported export type\")) { log.error(\"Bad export type argument\", e); } throw e; }","preventionTips":["Pass only enum constants documented for exportAllObjects","Keep exporter switch and RepositoryExportType enum in sync on upgrades","Never pass null as the export type"],"tags":["export","enum","unsupported-value","pdi"],"backgroundTag":"unsupported-enum-value","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"}