{"record":{"id":"55664139122116d5","repo":"pentaho/pentaho-kettle","slug":"ioerror-while-create","errorCode":null,"errorMessage":"IOError while create","messagePattern":"IOError while create","errorType":"exception","errorClass":"ContentCreationException","httpStatus":null,"severity":"error","filePath":"plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java","lineNumber":166,"sourceCode":"    String fileName = new File( name ).getName();\n    if ( RepositoryUtilities.isInvalidPathName( fileName ) ) {\n      throw new IllegalArgumentException( \"The name given is not valid.\" );\n    }\n    try {\n      final FileObject file = getBackend();\n      final FileObject child = file.resolveFile( fileName );\n      if ( child.exists() ) {\n        if ( child.getContent().getSize() == 0 ) {\n          // probably one of the temp files created by the pentaho-system\n          return new FileObjectContentItem( this, child );\n        }\n        throw new ContentCreationException( \"File already exists: \" + child );\n      }\n      try {\n        child.createFile();\n        return new FileObjectContentItem( this, child );\n      } catch ( IOException e ) {\n        throw new ContentCreationException( \"IOError while create\", e );\n      }\n    } catch ( FileSystemException e ) {\n      throw new RuntimeException( e );\n    }\n  }\n\n  /**\n   * Creates a new content location in the current location. This method must never return null. This method will fail\n   * if an entity with the same name exists in this location.\n   *\n   * @param name the name of the new entity.\n   * @return the newly created entity, never null.\n   * @throws ContentCreationException if the item could not be created.\n   */\n  public ContentLocation createLocation( final String name ) throws ContentCreationException {\n    if ( RepositoryUtilities.isInvalidPathName( name ) ) {\n      throw new IllegalArgumentException( \"The name given is not valid.\" );\n    }","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java#L148-L184","documentation":"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.","triggerScenarios":"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().","commonSituations":"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.","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."],"exampleFix":"// before\nContentItem item = location.createItem(\"report.prpt\");\n// after\nFile outDir = new File(outputPath);\nif (!outDir.exists()) outDir.mkdirs();\nif (!outDir.canWrite() || outDir.getFreeSpace() < minRequiredBytes) {\n  throw new IllegalStateException(\"Output dir not writable or full: \" + outputPath);\n}\nContentItem item = location.createItem(\"report.prpt\");","handlingStrategy":"try-catch","validationCode":"File dir = new File(outputPath);\nboolean ready = dir.exists() && dir.isDirectory() && dir.canWrite() && dir.getUsableSpace() > 0;","typeGuard":null,"tryCatchPattern":"try {\n  item = location.createItem(fileName);\n} catch (ContentCreationException e) {\n  Throwable cause = e.getCause(); // inspect real IOException\n  throw new IOException(\"Report create failed: \" + (cause == null ? e : cause.getMessage()), e);\n}","preventionTips":["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."],"tags":["io","vfs","file-write"],"backgroundTag":"file-write-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}