pentaho/pentaho-kettle · error · KettleException

unknown element type [" + element.getClass().getName() + "]

Error message

unknown element type [" + element.getClass().getName() + "]

What it means

Thrown by the private isRenamed method of PurRepository when computing the expected filename for an element whose RepositoryObjectType has no extension mapping in the switch. Indicates the element type is unknown to the rename-detection logic.

Solutions

  1. Set a valid RepositoryObjectType on the element before saving
  2. Use only supported element types with PurRepository
  3. Upgrade the pur plugin to a version matching your element types

Example fix

// before
element.setRepositoryElementType(RepositoryObjectType.valueOf("MY_TYPE"));
repository.save(element, null, null, null);
// after
element.setRepositoryElementType(RepositoryObjectType.TRANSFORMATION);
repository.save(element, null, null, null);
Defensive patterns

Strategy: type-guard

Validate before calling

RepositoryObjectType t = element.getRepositoryElementType();
if (t == null) throw new IllegalArgumentException("Element has no repository type");

Type guard

boolean hasKnownType(RepositoryElementInterface el) {
  return el.getRepositoryElementType() != null;
}

Try / catch

try {
  repository.save(element, null, null, null);
} catch (KettleException e) {
  if (e.getMessage().contains("unknown element type")) {
    log.error("Set a valid RepositoryObjectType on " + element.getClass().getName(), e);
  }
}

Prevention

When it happens

Trigger: Calling PurRepository.save() with an element whose type enum is not TRANSFORMATION, JOB, DATABASE, CLUSTER_SCHEMA, PARTITION_SCHEMA, etc., so isRenamed's default case throws.

Common situations: Programmatically constructed repository elements with missing/wrong repositoryElementType; new element types added in a PDI version not handled by this pur adapter.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java:2233

        filename += RepositoryObjectType.TRANSFORMATION.getExtension();
        break;
      case JOB:
        filename += RepositoryObjectType.JOB.getExtension();
        break;
      case DATABASE:
        filename += RepositoryObjectType.DATABASE.getExtension();
        break;
      case SLAVE_SERVER:
        filename += RepositoryObjectType.SLAVE_SERVER.getExtension();
        break;
      case CLUSTER_SCHEMA:
        filename += RepositoryObjectType.CLUSTER_SCHEMA.getExtension();
        break;
      case PARTITION_SCHEMA:
        filename += RepositoryObjectType.PARTITION_SCHEMA.getExtension();
        break;
      default:
        throw new KettleException( "unknown element type [" + element.getClass().getName() + "]" );
    }
    if ( !file.getName().equals( checkAndSanitize( filename ) ) ) {
      return true;
    }
    return false;
  }

  private void renameIfNecessary( final RepositoryElementInterface element, final RepositoryFile file )
    throws KettleException {
    if ( !isRenamed( element, file ) ) {
      return;
    }

    // ObjectId id = element.getObjectId();
    StringBuilder buf = new StringBuilder( file.getPath().length() );
    buf.append( getParentPath( file.getPath() ) );
    buf.append( RepositoryFile.SEPARATOR );
    buf.append( checkAndSanitize( element.getName() ) );

View on GitHub (pinned to f3058517a1)