pentaho/pentaho-kettle · error · ContentCreationException
Failed to create the content-location
Error message
Failed to create the content-location
What it means
In createLocation, after child.createFile() succeeds, constructing the new FileObjectContentLocation wrapper may itself throw ContentIOException; this is rethrown as ContentCreationException 'Failed to create the content-location' with the original exception chained.
Solutions
- Inspect the chained ContentIOException cause for the actual wrap failure.
- Verify the VFS scheme/provider used supports folder semantics (prefer file/local providers for output dirs).
- Delete the just-created child and retry, or use a different output location.
- Avoid createLocation on providers known to treat everything as files; use createItem for leaf outputs instead.
Example fix
// before
ContentLocation sub = location.createLocation("exports");
// after
try {
sub = location.createLocation("exports");
} catch (ContentCreationException e) {
// child may have been created as a plain file; remove and retry
location.getEntry("exports").delete();
sub = location.createLocation("exports");
} Defensive patterns
Strategy: try-catch
Try / catch
try {
sub = location.createLocation(name);
} catch (ContentCreationException e) {
Throwable cause = e.getCause(); // ContentIOException from wrapper construction
// cleanup partially created child and retry or abort with clear message
} Prevention
- Use VFS providers with proper folder semantics for output directories.
- Inspect chained causes when location creation fails.
- Test location creation against the target filesystem scheme early in development.
When it happens
Trigger: new FileObjectContentLocation(this, child) throwing ContentIOException — typically because the freshly created child does not behave as a folder in the backing VFS (e.g. provider created it as a plain file).
Common situations: Filesystem providers that don't distinguish folders from files (createFile produced a file, not a folder), so wrapping fails; unusual VFS schemes or corrupted temp output directories.
Understand the failure class
Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.
Related errors
- File already exists:
- File already exists.
- folder [
- Not File nor directory.
- AbstractFileErrorHandler.Exception.CouldNotCreateFileErrorHandlerForFile
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/0f98ecbc334f4881.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java:195
* @param name the name of the new entity.
* @return the newly created entity, never null.
* @throws ContentCreationException if the item could not be created.
*/
public ContentLocation createLocation( final String name ) throws ContentCreationException {
if ( RepositoryUtilities.isInvalidPathName( name ) ) {
throw new IllegalArgumentException( "The name given is not valid." );
}
try {
final FileObject file = getBackend();
final FileObject child = file.resolveFile( name );
if ( child.exists() ) {
throw new ContentCreationException( "File already exists." );
}
child.createFile();
try {
return new FileObjectContentLocation( this, child );
} catch ( ContentIOException e ) {
throw new ContentCreationException( "Failed to create the content-location", e );
}
} catch ( FileSystemException e ) {
throw new RuntimeException( e );
}
}
/**
* Checks, whether an content entity with the given name exists in this content location. This method will report
* invalid filenames as non-existent.
*
* @param name the name of the new entity.
* @return true, if an entity exists with this name, false otherwise.
*/
public boolean exists( final String name ) {
if ( RepositoryUtilities.isInvalidPathName( name ) ) {
return false;
}
try {View on GitHub (pinned to f3058517a1)