pentaho/pentaho-kettle · error · KettleException

Unsupported export type: ...

Error message

Unsupported export type: ...

What it means

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).

Solutions

  1. Log/inspect the exact type value in the message and use one of the supported export types.
  2. Update the switch in exportAllObjectsInternal to handle the new RepositoryExportType constant.
  3. If passing null, pass an explicit supported export type instead.
  4. Check for a version mismatch between code constructing the export type and the exporter implementation.

Example fix

// before: passing an unhandled type
exporter.exportAllObjects(monitor, "export.xml", null, someNewType);
// after: use a supported type
exporter.exportAllObjects(monitor, "export.xml", null, RepositoryExportType.ALL);
Defensive patterns

Strategy: type-guard

Validate before calling

EnumSet<RepositoryExportType> supported = EnumSet.of(RepositoryExportType.ALL /* + other handled types */);
if (type == null || !supported.contains(type)) throw new IllegalArgumentException("Unsupported export type: " + type);

Type guard

static boolean isSupportedExportType(RepositoryExportType t) { return t != null && t != RepositoryExportType.valueOf-less-new-constants; } // implement via switch matching handled cases

Try / catch

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

Prevention

When it happens

Trigger: 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.

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

Related errors


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

Appendix: source

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

          exportTransformations( monitor, root, writer, feedback );
          monitor.worked( 50 );
          exportJobs( monitor, root, writer, feedback );
          monitor.worked( 50 );
          break;
        }
        case TRANS: {
          exportTransformations( monitor, root, writer, feedback );
          monitor.worked( 100 );
          break;
        }
        case JOBS: {
          exportJobs( monitor, root, writer, feedback );
          monitor.worked( 100 );
          break;
        }
        default: {
          // this will never happens
          throw new KettleException( "Unsupported export type: " + type );
        }
      }
      monitor.subTask( BaseMessages.getString( PKG, "Repository.Exporter.Monitor.SavingResultFile" ) );
    } finally {
      try {
        if ( writer != null ) {
          writer.close();
        }
      } catch ( Exception e ) {
        log.logDebug( BaseMessages.getString( PKG, "Repository.Exporter.Exception.CloseExportFile", xmlFilename ) );
      }
    }
    if ( monitor != null ) {
      monitor.done();
    }
    return this.feedbackList;
  }

View on GitHub (pinned to f3058517a1)