pentaho/pentaho-kettle · error · KettleException

PurRepository.fileCreateException

PurRepository.fileCreateException

Error message

PurRepository.fileCreateException (localized, takes file name; error creating file)

What it means

When creating a new file, a SOAPFaultException whose message contains UnifiedRepositoryCreateFileException.PREFIX means the repository server refused to create the file. PurRepository rewraps it into a localized 'error creating file' KettleException with the file name — usually because a file with that name already exists in the target folder.

Solutions

  1. Rename the file or choose a different folder and retry
  2. Check whether the target folder already contains a file with the same name and delete/archive it first
  3. Verify the user has create permission in the destination directory
  4. Inspect the repository server logs for the wrapped UnifiedRepositoryCreateFileException cause

Example fix

// before
repository.save(transMeta, "v", null, true); // name already exists -> error
// after
if (!repository.exists(transMeta.getRepositoryDirectory().getPath() + "/" + transMeta.getName() + ".ktr", null)) {
  repository.save(transMeta, "v", null, true);
}
Defensive patterns

Strategy: validation

Validate before calling

String path = element.getRepositoryDirectory().getPath() + "/" + element.getName()
    + element.getRepositoryElementType().getExtension();
if (repository.exists(path, null)) {
  throw new KettleException("File already exists: " + path);
}

Try / catch

try {
  repository.save(element, comment, null, true);
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("error creating")) {
    // pick a unique name or different folder, then retry
  } else throw e;
}

Prevention

When it happens

Trigger: pur.createFile(...) throws SOAPFaultException containing UnifiedRepositoryCreateFileException.PREFIX, typically for a name collision in the destination folder.

Common situations: Saving a transformation/job with a name that already exists in the chosen folder; creating a file where the user lacks create permission; transient repository server errors during creation.

Understand the failure class

Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.

Related errors


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

Appendix: source

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

    } else {

      int dataSize = calculateDataSize( element );

      readWriteLock.writeLock().lock();
      try {
        file =
          new RepositoryFile.Builder( checkAndSanitize( element.getName()
            + element.getRepositoryElementType().getExtension() ) ).versioned( true ).title(
            RepositoryFile.DEFAULT_LOCALE, element.getName() ).createdDate(
            versionDate != null ? versionDate.getTime() : new Date() ).description( RepositoryFile.DEFAULT_LOCALE,
            Const.NVL( element.getDescription(), "" ) ).fileSize( dataSize ).build();

        file =
          pur.createFile( element.getRepositoryDirectory().getObjectId().getId(), file,
            new NodeRepositoryFileData( objectTransformer.elementToDataNode( element ), dataSize ), versionComment );
      } catch ( SOAPFaultException e ) {
        if ( e.getMessage().contains( UnifiedRepositoryCreateFileException.PREFIX ) ) {
          throw new KettleException(
            BaseMessages.getString( PKG, "PurRepository.fileCreateException", file.getName() ) );
        }
      } finally {
        readWriteLock.writeLock().unlock();
      }
    }
    // side effects
    ObjectId objectId = new StringObjectId( file.getId().toString() );
    element.setObjectId( objectId );
    if ( loadRevision ) {
      element.setObjectRevision( getObjectRevision( objectId, null ) );
    }
    if ( element instanceof ChangedFlagInterface ) {
      ( (ChangedFlagInterface) element ).clearChanged();
    }

    if ( element.getRepositoryElementType() == RepositoryObjectType.TRANSFORMATION ) {
      TransMeta transMeta = loadTransformation( objectId, null );

View on GitHub (pinned to f3058517a1)