pentaho/pentaho-kettle · error · KettleException

RepositoryImporter.ErrorDetectFileType

Error message

RepositoryImporter.ErrorDetectFileType

What it means

RepositoryImporter.importAll throws this KettleException when a repository object being imported has a type it does not know how to handle. The switch statement handles TRANSFORMATION and JOB types; any other RepositoryObjectType (e.g. a newer artifact type or corrupted metadata) falls through to the default branch because the importer cannot detect/resolve the object's file type.

Solutions

  1. Inspect the object being imported at the failure point and remove or convert the unsupported artifact from the export before re-importing.
  2. Verify all .ktr/.kjb files have correct extensions and valid XML headers so the importer detects the type correctly.
  3. Import with a Pentaho/Kettle version equal to or newer than the version the export was produced from.
  4. Extend the switch in importAll to handle the new RepositoryObjectType if you maintain a fork and genuinely need that type.

Example fix

// before: importing a mixed export
repositoryImporter.importAll();

// after: filter unsupported files out of the export first
List<File> importable = files.stream()
    .filter(f -> f.getName().endsWith(".ktr") || f.getName().endsWith(".kjb"))
    .collect(Collectors.toList());
repositoryImporter.importAll(); // only supported types remain
Defensive patterns

Strategy: try-catch

Validate before calling

// before importing, keep only supported object types
boolean supported = f.getName().endsWith(".ktr") || f.getName().endsWith(".kjb");

Type guard

boolean isImportable(RepositoryObjectType t) {
  return t == RepositoryObjectType.TRANSFORMATION || t == RepositoryObjectType.JOB;
}

Try / catch

try {
  importer.importAll();
} catch (KettleException e) {
  if (e.getMessage().contains("RepositoryImporter.ErrorDetectFileType")) {
    log.warn("Skipped unsupported repository object during import");
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling RepositoryImporter.importAll() (or via RepositoryImportRunnable/PDI UI import) against a repository containing an object whose RepositoryObjectType is neither TRANSFORMATION nor JOB — e.g. importing an exported repository zip that contains metadata objects, rules, or unsupported file types.

Common situations: Importing an export from a newer Pentaho version that includes object types this build doesn't understand; corrupted .ktr/.kjb file with wrong extension so type detection fails; importing a directory dump that includes non-job/transformation artifacts.

Understand the failure class

Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/RepositoryImporter.java:247

          addException( e );
          feedback.showError( BaseMessages.getString( PKG, "RepositoryImporter.ErrorGeneral.Title" ), BaseMessages
              .getString( PKG, "RepositoryImporter.ErrorGeneral.Message" ), e );
        }
      }

      // Correct those jobs and transformations that contain references to other objects.
      for ( RepositoryObject repoObject : referencingObjects ) {
        switch ( repoObject.getObjectType() ) {
          case TRANSFORMATION:
            TransMeta transMeta = rep.loadTransformation( repoObject.getObjectId(), null );
            saveTransformationToRepo( transMeta, feedback );
            break;
          case JOB:
            JobMeta jobMeta = rep.loadJob( repoObject.getObjectId(), null );
            saveJobToRepo( jobMeta, feedback );
            break;
          default:
            throw new KettleException( BaseMessages.getString( PKG, "RepositoryImporter.ErrorDetectFileType" ) );
        }
      }

      feedback.addLog( BaseMessages.getString( PKG, "RepositoryImporter.ImportFinished.Log" ) );
    } catch ( Exception e ) {
      addException( e );
      feedback.showError( BaseMessages.getString( PKG, "RepositoryImporter.ErrorGeneral.Title" ), BaseMessages
          .getString( PKG, "RepositoryImporter.ErrorGeneral.Message" ), e );
    } finally {
      // set the repository import location to null when done!
      RepositoryImportLocation.setRepositoryImportLocation( null );
    }
  }

  /**
   * Load the shared objects up front, replace them in the xforms/jobs loaded from XML. We do this for performance
   * reasons.
   *

View on GitHub (pinned to f3058517a1)