{"record":{"id":"a0c2a0e6b488885b","repo":"pentaho/pentaho-kettle","slug":"io-exception-occured-orabulkdataoutput","errorCode":null,"errorMessage":"IO exception occured: ","messagePattern":"IO exception occured: ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkDataOutput.java","lineNumber":91,"sourceCode":"      } else {\n        // Else open the data file filled in.\n        String dataFilePath = getFilename( getFileObject( bowl, space.environmentSubstitute( meta.getDataFile() ), space ) );\n        File dataFile = new File( dataFilePath );\n        // Make sure the parent directory exists\n        dataFile.getParentFile().mkdirs();\n        os = new FileOutputStream( dataFile, false );\n      }\n\n      String encoding = meta.getEncoding();\n      if ( Utils.isEmpty( encoding ) ) {\n        // Use the default encoding.\n        output = new BufferedWriter( new OutputStreamWriter( os ) );\n      } else {\n        // Use the specified encoding\n        output = new BufferedWriter( new OutputStreamWriter( os, encoding ) );\n      }\n    } catch ( IOException e ) {\n      throw new KettleException( \"IO exception occured: \" + e.getMessage(), e );\n    }\n  }\n\n  public void close() throws IOException {\n    if ( output != null ) {\n      output.close();\n    }\n  }\n\n  Writer getOutput() {\n    return output;\n  }\n\n  private String createEscapedString( String orig, String enclosure ) {\n    StringBuilder buf = new StringBuilder( orig );\n\n    Const.repl( buf, enclosure, enclosure + enclosure );\n    return buf.toString();","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkDataOutput.java#L73-L109","documentation":"OraBulkDataOutput.open creates the data file for the Oracle SQL*Loader and wraps it in a BufferedWriter. If creating or wrapping the output stream throws an IOException, it is rethrown as a KettleException 'IO exception occured: <message>'. It means the loader could not open/write its staging data file.","triggerScenarios":"open() is called and new FileOutputStream/OutputStreamWriter fails: bad file path, no write permission, disk full, or directory does not exist.","commonSituations":"Invalid temp/data directory configured for the loader; read-only mount or missing directory; disk quota exceeded on the server running PDI; filename containing illegal characters for the OS.","solutions":["Check the chained IOException message for the exact filesystem reason (No such file, Permission denied, No space left)","Verify the directory the data file is written to exists and is writable by the PDI user","Free disk space or point the loader's file/directory setting at a valid writable location"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"File dir = new File( outputDir );\nif ( !dir.isDirectory() || !dir.canWrite() ) {\n  throw new KettleException( \"Output dir not writable: \" + outputDir );\n}","typeGuard":null,"tryCatchPattern":"try {\n  oraOutput.open();\n} catch ( KettleException e ) {\n  logError( \"Cannot open data file: \" + e.getMessage(), e );\n}","preventionTips":["Ensure the loader's file directory exists and is writable by the PDI user","Monitor disk space on the staging filesystem","Avoid special characters in configured file paths"],"tags":["io","oracle","sqlldr","file"],"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"}