{"record":{"id":"e1ab5be743c6caae","repo":"pentaho/pentaho-kettle","slug":"repositoryimporter-errordetectfiletype","errorCode":null,"errorMessage":"RepositoryImporter.ErrorDetectFileType","messagePattern":"RepositoryImporter\\.ErrorDetectFileType","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/RepositoryImporter.java","lineNumber":247,"sourceCode":"          addException( e );\n          feedback.showError( BaseMessages.getString( PKG, \"RepositoryImporter.ErrorGeneral.Title\" ), BaseMessages\n              .getString( PKG, \"RepositoryImporter.ErrorGeneral.Message\" ), e );\n        }\n      }\n\n      // Correct those jobs and transformations that contain references to other objects.\n      for ( RepositoryObject repoObject : referencingObjects ) {\n        switch ( repoObject.getObjectType() ) {\n          case TRANSFORMATION:\n            TransMeta transMeta = rep.loadTransformation( repoObject.getObjectId(), null );\n            saveTransformationToRepo( transMeta, feedback );\n            break;\n          case JOB:\n            JobMeta jobMeta = rep.loadJob( repoObject.getObjectId(), null );\n            saveJobToRepo( jobMeta, feedback );\n            break;\n          default:\n            throw new KettleException( BaseMessages.getString( PKG, \"RepositoryImporter.ErrorDetectFileType\" ) );\n        }\n      }\n\n      feedback.addLog( BaseMessages.getString( PKG, \"RepositoryImporter.ImportFinished.Log\" ) );\n    } catch ( Exception e ) {\n      addException( e );\n      feedback.showError( BaseMessages.getString( PKG, \"RepositoryImporter.ErrorGeneral.Title\" ), BaseMessages\n          .getString( PKG, \"RepositoryImporter.ErrorGeneral.Message\" ), e );\n    } finally {\n      // set the repository import location to null when done!\n      RepositoryImportLocation.setRepositoryImportLocation( null );\n    }\n  }\n\n  /**\n   * Load the shared objects up front, replace them in the xforms/jobs loaded from XML. We do this for performance\n   * reasons.\n   *","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/RepositoryImporter.java#L229-L265","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the object being imported at the failure point and remove or convert the unsupported artifact from the export before re-importing.","Verify all .ktr/.kjb files have correct extensions and valid XML headers so the importer detects the type correctly.","Import with a Pentaho/Kettle version equal to or newer than the version the export was produced from.","Extend the switch in importAll to handle the new RepositoryObjectType if you maintain a fork and genuinely need that type."],"exampleFix":"// before: importing a mixed export\nrepositoryImporter.importAll();\n\n// after: filter unsupported files out of the export first\nList<File> importable = files.stream()\n    .filter(f -> f.getName().endsWith(\".ktr\") || f.getName().endsWith(\".kjb\"))\n    .collect(Collectors.toList());\nrepositoryImporter.importAll(); // only supported types remain","handlingStrategy":"try-catch","validationCode":"// before importing, keep only supported object types\nboolean supported = f.getName().endsWith(\".ktr\") || f.getName().endsWith(\".kjb\");","typeGuard":"boolean isImportable(RepositoryObjectType t) {\n  return t == RepositoryObjectType.TRANSFORMATION || t == RepositoryObjectType.JOB;\n}","tryCatchPattern":"try {\n  importer.importAll();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"RepositoryImporter.ErrorDetectFileType\")) {\n    log.warn(\"Skipped unsupported repository object during import\");\n  } else { throw e; }\n}","preventionTips":["Export and import with matching (or newer) Pentaho/Kettle versions","Keep repository exports limited to transformations and jobs","Validate file extensions and XML headers before bulk imports"],"tags":["kettle","repository-import","unsupported-type","file-type-detection"],"backgroundTag":"incompatible-source-type","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"}