{"record":{"id":"346728966a767121","repo":"pentaho/pentaho-kettle","slug":"excelinputlog-imagefilenotexists","errorCode":"ExcelInputLog.ImageFileNotExists","errorMessage":"ExcelInputLog.ImageFileNotExists (localized message with image path)","messagePattern":"ExcelInputLog\\.ImageFileNotExists \\(localized message with image path\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/exceloutput/ExcelOutput.java","lineNumber":812,"sourceCode":"    }\n    data.headerCellFormat = new WritableCellFormat( writableHeaderFont );\n\n    // Header background color\n    if ( meta.getHeaderBackGroundColor() != ExcelOutputMeta.FONT_COLOR_NONE ) {\n      data.headerCellFormat.setBackground( ExcelFontMap.getColour( meta.getHeaderBackGroundColor(), null ) );\n    }\n\n    // Set alignment\n    data.headerCellFormat = ExcelFontMap.getAlignment( meta.getHeaderAlignment(), data.headerCellFormat );\n    data.headerCellFormat = ExcelFontMap.getOrientation( meta.getHeaderFontOrientation(), data.headerCellFormat );\n\n    // Do we need to put a image on the header\n    if ( !Utils.isEmpty( data.realHeaderImage ) ) {\n      InputStream imageStream = null;\n      try ( FileObject imageFile = KettleVFS.getInstance( getTransMeta().getBowl() )\n              .getFileObject( data.realHeaderImage ) ) {\n        if ( !imageFile.exists() ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"ExcelInputLog.ImageFileNotExists\", data.realHeaderImage ) );\n        }\n        data.realHeaderImage = KettleVFS.getFilename( imageFile );\n        // Put an image\n        Dimension m = ExcelFontMap.getImageDimension( data.realHeaderImage );\n        data.headerImageWidth = m.getWidth() * 0.016;\n        data.headerImageHeight = m.getHeight() * 0.0625;\n\n        byte[] imageData = new byte[(int) imageFile.getContent().getSize()];\n        imageStream = KettleVFS.getInputStream( imageFile );\n        imageStream.read( imageData );\n\n        data.headerImage = new WritableImage( 0, 0, data.headerImageWidth, data.headerImageHeight, imageData );\n      } catch ( Exception e ) {\n        throw new KettleException( e );\n      }\n    }\n\n    // --- Set rows font","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/exceloutput/ExcelOutput.java#L794-L830","documentation":"When the ExcelOutput step is configured with a header image, setFonts resolves the image via KettleVFS and throws this localized KettleException if the file does not exist. The message embeds the configured image path so the user can see exactly which file was missing.","triggerScenarios":"setFonts() is called from openNewFile() when data.realHeaderImage is non-empty and KettleVFS.getFileObject(...).exists() returns false — i.e. the configured header image path resolves to a nonexistent file.","commonSituations":"Header image filename typo or wrong directory; relative path resolved against a different working directory than expected; image deleted or moved after the step was configured; environment variable in the image path not substituted to a valid location.","solutions":["Check the 'Header image' field in the Excel Output step dialog and correct the path (the error message shows the exact path used).","Use an absolute path or a path relative to the transformation's working directory, and verify the file exists at runtime (ls / stat).","If the path uses ${VARIABLES}, confirm they are set in the execution environment and substitute to an existing file.","Copy the image to a location readable by the PDI process user (permissions can make exists() false for inaccessible paths on some VFS providers).","Clear the header image setting if the image is optional and its absence should not abort the transformation."],"exampleFix":"// before: relative path that may resolve incorrectly\nString img = \"images/logo.png\";\n// after: resolve explicitly and verify\nFile imgFile = new File( \"${Internal.Transformation.Filename.Directory}/images/logo.png\" );\nif ( !imgFile.exists() ) {\n  throw new KettleException( \"Header image not found: \" + imgFile.getAbsolutePath() );\n}","handlingStrategy":"validation","validationCode":"File img = new File( imagePath );\nif ( !img.isFile() ) throw new IllegalArgumentException( \"Header image missing: \" + img.getAbsolutePath() );","typeGuard":null,"tryCatchPattern":"try { /* configure header image */ } catch ( KettleException e ) { logError( \"Header image error: \" + e.getMessage() ); throw e; }","preventionTips":["Use absolute paths or ${Internal.Transformation.Filename.Directory} for the header image.","Verify the image exists at runtime before scheduling the transformation.","Avoid variables in the image path unless they are guaranteed set in every environment."],"tags":["pentaho-kettle","excel-output","vfs","header-image"],"backgroundTag":"file-not-found","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"}