{"record":{"id":"b7a2de4734ec6ba0","repo":"pentaho/pentaho-kettle","slug":"object-type-objecttype-was-specified-only-information-from","errorCode":null,"errorMessage":"Object type {objectType} was specified.  Only information from transformations, jobs and databases can be retrieved at this time.","messagePattern":"Object type (.+?) was specified\\.  Only information from transformations, jobs and databases can be retrieved at this time\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/KettleDatabaseRepository.java","lineNumber":2024,"sourceCode":"\n        case JOB: {\n          RowMetaAndData row = jobDelegate.getJob( objectId );\n          name = row.getString( KettleDatabaseRepository.FIELD_JOB_NAME, null );\n          description = row.getString( KettleDatabaseRepository.FIELD_JOB_DESCRIPTION, null );\n          modifiedUser = row.getString( KettleDatabaseRepository.FIELD_JOB_MODIFIED_USER, \"-\" );\n          modifiedDate = row.getDate( KettleDatabaseRepository.FIELD_JOB_MODIFIED_DATE, null );\n          dirId = row.getInteger( KettleDatabaseRepository.FIELD_JOB_ID_DIRECTORY, 0 );\n          break;\n        }\n        //PDI-15871 Return available information for DATABASE\n        case DATABASE: {\n          RowMetaAndData row = databaseDelegate.getDatabase( objectId );\n          name = row.getString( KettleDatabaseRepository.FIELD_DATABASE_NAME, null );\n          return new RepositoryObject(\n              objectId, name, null, null, null, objectType, null, false );\n        }\n        default:\n          throw new KettleException( \"Object type \"\n            + objectType.getTypeDescription()\n            + \" was specified.  Only information from transformations, jobs and databases can be retrieved at this time.\" );\n          // Nothing matches, return null\n      }\n\n      boolean isDeleted = ( name == null );\n      directory = loadRepositoryDirectoryTree().findDirectory( new LongObjectId( dirId ) );\n      return new RepositoryObject(\n        objectId, name, directory, modifiedUser, modifiedDate, objectType, description, isDeleted );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to get object information for object with id=\" + objectId, e );\n    }\n  }\n\n  public JobMeta loadJob( ObjectId idJob, String versionLabel ) throws KettleException {\n    RepositoryObject jobInfo = getObjectInformation( idJob, RepositoryObjectType.JOB );\n    return loadJob( jobInfo.getName(), jobInfo.getRepositoryDirectory(), null, versionLabel );\n  }","sourceCodeStart":2006,"sourceCodeEnd":2042,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/KettleDatabaseRepository.java#L2006-L2042","documentation":"KettleDatabaseRepository's object-information retrieval only supports transformations, jobs and databases; the default branch of the type switch throws a KettleException when any other RepositoryObjectType (slave server, cluster schema, partition schema, etc.) is requested. It is an explicit capability limit of getObjectInformation for this repository type.","triggerScenarios":"Calling repo.getObjectInformation(objectId, objectType) with objectType such as RepositoryObjectType.CLUSTER_SCHEMA or SLAVE_SERVER, or with a guessed/default object type.","commonSituations":"Generic repository browsers that request object info for any tree node; scripts that resolve object types from file extensions and hit non-T/J/D types; plugin code assuming full getObjectInformation coverage.","solutions":["Restrict getObjectInformation calls to TRANSFORMATION, JOB and DATABASE object types and handle others separately.","Use the dedicated accessors for other types (getSlaveServer, getClusterSchema, getPartitionSchema) instead.","Check objectType.getTypeDescription() and branch before calling; return a not-supported result gracefully."],"exampleFix":"// before\nRepositoryObject obj = repo.getObjectInformation(id, objectType);\n// after\nif (objectType != RepositoryObjectType.TRANSFORMATION\n    && objectType != RepositoryObjectType.JOB\n    && objectType != RepositoryObjectType.DATABASE) {\n  return null; // use type-specific getters instead\n}\nRepositoryObject obj = repo.getObjectInformation(id, objectType);","handlingStrategy":"type-guard","validationCode":"boolean infoSupported = objectType == RepositoryObjectType.TRANSFORMATION\n    || objectType == RepositoryObjectType.JOB || objectType == RepositoryObjectType.DATABASE;\nif (!infoSupported) { return null; /* or use type-specific getter */ }","typeGuard":"boolean supportsObjectInfo(RepositoryObjectType t) {\n  return t == RepositoryObjectType.TRANSFORMATION || t == RepositoryObjectType.JOB\n    || t == RepositoryObjectType.DATABASE;\n}","tryCatchPattern":"try {\n  return repo.getObjectInformation(id, objectType);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Only information from transformations, jobs and databases\")) {\n    return null; // fall back to type-specific getter\n  } else { throw e; }\n}","preventionTips":["Restrict getObjectInformation to transformation/job/database types.","Route other object kinds to their dedicated repository getters.","Handle the default branch in generic browser code instead of letting it throw."],"tags":["repository","unsupported-type","object-information"],"backgroundTag":"unsupported-operation","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"}