pentaho/pentaho-kettle · error · ContentCreationException
IOError while create
Error message
IOError while create
What it means
In FileObjectContentLocation.createItem, after confirming the child does not exist, child.createFile() is called; any IOException from the underlying commons-vfs filesystem is rethrown as ContentCreationException 'IOError while create'. The original IOException is attached as the cause.
Solutions
- Inspect the cause IOException (getCause()) to see the real filesystem error.
- Ensure the output directory exists, is writable, and has free space.
- Re-check that the parent location is still valid before creating items.
- Add retry with a fresh FileObjectContentLocation if using remote/temp filesystems.
Example fix
// before
ContentItem item = location.createItem("report.prpt");
// after
File outDir = new File(outputPath);
if (!outDir.exists()) outDir.mkdirs();
if (!outDir.canWrite() || outDir.getFreeSpace() < minRequiredBytes) {
throw new IllegalStateException("Output dir not writable or full: " + outputPath);
}
ContentItem item = location.createItem("report.prpt"); Defensive patterns
Strategy: try-catch
Validate before calling
File dir = new File(outputPath); boolean ready = dir.exists() && dir.isDirectory() && dir.canWrite() && dir.getUsableSpace() > 0;
Try / catch
try {
item = location.createItem(fileName);
} catch (ContentCreationException e) {
Throwable cause = e.getCause(); // inspect real IOException
throw new IOException("Report create failed: " + (cause == null ? e : cause.getMessage()), e);
} Prevention
- Pre-create and verify the output directory (exists, writable, has space).
- Monitor disk space on temp/output volumes.
- Don't delete output directories mid-run.
When it happens
Trigger: child.createFile() throwing IOException — e.g. the parent folder vanished, disk full, permission denied, or the filesystem went read-only between the exists() check and createFile().
Common situations: Writing reports to a full or read-only disk, a temp directory removed mid-run, network/remote VFS mounts that dropped, or OS permission changes on the output folder.
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
- KettleVFS.Exception.ParentDirectoryDoesNotExist
- ChangeFileEncoding.Error.CreatingFile
- Couldn't write to the database cache
- Error opening new file
- ex.getMessage()
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/55664139122116d5.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java:166
String fileName = new File( name ).getName();
if ( RepositoryUtilities.isInvalidPathName( fileName ) ) {
throw new IllegalArgumentException( "The name given is not valid." );
}
try {
final FileObject file = getBackend();
final FileObject child = file.resolveFile( fileName );
if ( child.exists() ) {
if ( child.getContent().getSize() == 0 ) {
// probably one of the temp files created by the pentaho-system
return new FileObjectContentItem( this, child );
}
throw new ContentCreationException( "File already exists: " + child );
}
try {
child.createFile();
return new FileObjectContentItem( this, child );
} catch ( IOException e ) {
throw new ContentCreationException( "IOError while create", e );
}
} catch ( FileSystemException e ) {
throw new RuntimeException( e );
}
}
/**
* Creates a new content location in the current location. This method must never return null. This method will fail
* if an entity with the same name exists in this location.
*
* @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." );
}View on GitHub (pinned to f3058517a1)