{"record":{"id":"fa64600d8cc22142","repo":"pentaho/pentaho-kettle","slug":"cubeinputmeta-exception-unabletoclosecubefile","errorCode":"CubeInputMeta.Exception.UnableToCloseCubeFile","errorMessage":"CubeInputMeta.Exception.UnableToCloseCubeFile","messagePattern":"CubeInputMeta\\.Exception\\.UnableToCloseCubeFile","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"warning","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/cubeinput/CubeInputMeta.java","lineNumber":185,"sourceCode":"        add.getValueMeta( i ).setOrigin( name );\n      }\n      r.mergeRowMeta( add );\n    } catch ( KettleFileException kfe ) {\n      throw new KettleStepException(\n        BaseMessages.getString( PKG, \"CubeInputMeta.Exception.UnableToReadMetaData\" ), kfe );\n    } catch ( IOException e ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"CubeInputMeta.Exception.ErrorOpeningOrReadingCubeFile\" ), e );\n    } finally {\n      try {\n        if ( fis != null ) {\n          fis.close();\n        }\n        if ( dis != null ) {\n          dis.close();\n        }\n      } catch ( IOException ioe ) {\n        throw new KettleStepException( BaseMessages.getString(\n          PKG, \"CubeInputMeta.Exception.UnableToCloseCubeFile\" ), ioe );\n      }\n    }\n  }\n\n  @Override public String getXML() {\n    StringBuilder retval = new StringBuilder( 300 );\n\n    retval.append( \"    <file>\" ).append( Const.CR );\n    retval.append( \"      \" ).append( XMLHandler.addTagValue( \"name\", filename ) );\n    retval.append( \"    </file>\" ).append( Const.CR );\n    retval.append( \"    \" ).append( XMLHandler.addTagValue( \"limit\", rowLimit ) );\n    retval.append( \"    \" ).append( XMLHandler.addTagValue( \"addfilenameresult\", addfilenameresult ) );\n\n    return retval.toString();\n  }\n\n  @Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases )","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/cubeinput/CubeInputMeta.java#L167-L203","documentation":"After reading the cube file's metadata, getFields closes the FileInputStream and DataInputStream in a finally block. If closing either stream throws IOException, this KettleStepException wraps it, signaling the cube file could not be closed cleanly.","triggerScenarios":"fis.close() or dis.close() in the finally block of getFields throws IOException.","commonSituations":"Filesystem/network storage issues (NFS stalls), stream already closed in a custom state, OS-level file descriptor problems. Rare in practice.","solutions":["Check storage health/availability of the filesystem hosting the cube file.","Investigate the wrapped IOException root cause for the exact close failure.","Retry the operation; transient network-storage errors often resolve on retry.","Upgrade PDI — newer code uses try-with-resources, avoiding this path."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  meta.getFields( row, name, null, null, null, metaStore );\n} catch ( KettleStepException e ) {\n  logWarn( \"Non-fatal close failure on cube file: \" + e.getMessage(), e );\n}","preventionTips":["Ensure stable filesystem/network storage for cube files.","Avoid closing the same stream concurrently from multiple threads.","Upgrade to PDI versions using try-with-resources."],"tags":["kettle","pdi","io","resource-cleanup"],"backgroundTag":"file-read-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"}