pentaho/pentaho-kettle · error · KettleException
Unable to get ID for [type] [name]
Error message
Unable to get ID for [type] [name]
What it means
getObjectID(name, type) failed: it resolves an object name of a given RepositoryObjectType to its ObjectId by listing all files of that type and matching the title; any exception is wrapped as 'Unable to get ID for [type] [name]'. Returns null-ish objectId when not found; throws only when the lookup itself fails.
Solutions
- Check the wrapped cause first: distinguish lookup failure (throw) from not-found (returns null).
- Verify the object exists via the repository browser UI before resolving its ID by name.
- Ensure the user has read access to the folder containing that object type.
- Handle the null return for missing names instead of relying on exceptions.
Example fix
// before
ObjectId id = repo.getDatabaseID("MySQL DW");
// after
ObjectId id = repo.getDatabaseID("MySQL DW");
if (id == null) {
throw new KettleException("Database 'MySQL DW' not found");
} Defensive patterns
Strategy: validation
Validate before calling
if (name == null || name.isBlank()) throw new IllegalArgumentException("Name required for ID lookup"); Type guard
null
Try / catch
try {
id = repo.getDatabaseID(name);
} catch (KettleException e) {
log.error("ID lookup for {} failed: {}", name, e.getCause());
throw e;
}
if (id == null) throw new KettleException(name + " not found"); Prevention
- Distinguish null (not found) from thrown exceptions (lookup failure).
- Confirm read access to the type's folder before name lookups.
- Cache resolved IDs only for the current session.
When it happens
Trigger: Calling getDatabaseID/getClusterID/etc. (all delegating to getObjectID) when the listing of all files of the type throws, or when matching logic fails unexpectedly — bad type, service error, unreadable folder.
Common situations: Looking up a transformation/job/database by name against a folder the user cannot read; passing a name that never existed (not an exception here, returns null); server connectivity loss.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- AbsSecurityProvider.ERROR_0002_UNABLE_TO_ACCESS_IS_ALLOWED
- AddSequenceMeta.Exception.UnableToReadStepInfo
- AddSequenceMeta.Exception.UnableToSaveStepInfo
- Attempting to create PDI Repository with no Active…
- Cannot delete another users home directory
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/5b2968bb0417df69.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java:1037
private ObjectId getObjectID( String name, RepositoryObjectType type ) throws KettleException {
try {
ObjectId objectId = getObjectId( name, null, type, false );
if ( objectId == null ) {
List<RepositoryFile> allFilesOfType = getAllFilesOfType( null, type, false );
String[] existingNames = new String[ allFilesOfType.size() ];
for ( int i = 0; i < allFilesOfType.size(); i++ ) {
RepositoryFile file = allFilesOfType.get( i );
existingNames[ i ] = file.getTitle();
}
int index = DatabaseMeta.indexOfName( existingNames, name );
if ( index != -1 ) {
return new StringObjectId( allFilesOfType.get( index ).getId().toString() );
}
}
return objectId;
} catch ( Exception e ) {
throw new KettleException( "Unable to get ID for " + type + " [" + name + "]", e );
}
}
/**
* Copying the behavior of the original JCRRepository, this implementation returns IDs of deleted objects too.
*/
private ObjectId getObjectId( final String name, final RepositoryDirectoryInterface dir,
final RepositoryObjectType objectType, boolean includedDeleteFiles ) {
final String absPath = getPath( name, dir, objectType );
readWriteLock.readLock().lock();
try {
RepositoryFile file;
file = pur.getFile( absPath );
if ( file != null ) {
// file exists
return new StringObjectId( file.getId().toString() );View on GitHub (pinned to f3058517a1)