pentaho/pentaho-kettle · error · RuntimeException

Unable to draw image onto report

Error message

Unable to draw image onto report

What it means

TransJobDrawable.draw renders a transformation or job image into a report's Graphics2D context. Any exception thrown during drawing (by TransInformation/JobInformation.drawImage) is caught and rethrown as a RuntimeException with this message, which aborts report generation.

Solutions

  1. Verify the transformation/job file path configured in the AutoDoc step exists and is readable.
  2. Open the referenced .ktr/.kjb in Spoon to confirm it loads without errors.
  3. Check the wrapped cause (e.getCause()) to identify the exact drawing/loading failure.
  4. Update the report area size/rectangle if the image does not fit.
  5. Regenerate the AutoDoc step configuration pointing to a valid metadata file.

Example fix

// before
String location = environmentSubstitute(meta.getFilename()); // may not exist
// after
File f = new File(environmentSubstitute(meta.getFilename()));
if (!f.canRead()) throw new KettleException("Referenced job/trans not readable: " + f);
Defensive patterns

Strategy: validation

Validate before calling

// before building the report
String path = environmentSubstitute(meta.getFilename());
java.io.File f = new java.io.File(path);
if (!f.isFile() || !f.canRead()) {
  throw new IllegalStateException("Drawable job/trans not readable: " + path);
}

Try / catch

try {
  drawable.draw(bowl, g2d, rect, location, pixelate);
} catch (RuntimeException e) {
  log.error("draw failed: " + e.getCause(), e);
  // skip the image area instead of failing the whole report
}

Prevention

When it happens

Trigger: Calling draw during report build when the referenced transformation/job (by location) cannot be loaded or its layout cannot be computed — missing file, unparseable metadata, or Graphics2D drawing failure.

Common situations: The .ktr/.kjb file referenced by the AutoDoc step was moved/renamed, the file fails to load due to XML errors, or the target rectangle is degenerate causing drawing to fail.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/83a9fbf4c3360780. Report an issue: GitHub.

Appendix: source

Thrown at plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/autodoc/TransJobDrawable.java:46

  public TransJobDrawable( Bowl bowl, ReportSubjectLocation location, boolean pixelateImages ) {
    this.bowl = bowl;
    this.location = location;
    this.pixelateImages = pixelateImages;
  }

  @Override
  public void draw( Graphics2D graphics2D, Rectangle2D rectangle2D ) {
    try {
      if ( location.isTransformation() ) {
        TransformationInformation ti = TransformationInformation.getInstance();
        ti.drawImage( bowl, graphics2D, rectangle2D, location, pixelateImages );
      } else {
        JobInformation ji = JobInformation.getInstance();
        ji.drawImage( bowl, graphics2D, rectangle2D, location, pixelateImages );
      }
    } catch ( Exception e ) {
      throw new RuntimeException( "Unable to draw image onto report", e );
    }
  }

  /**
   * @return the pixelateImages
   */
  public boolean isPixelateImages() {
    return pixelateImages;
  }

  /**
   * @param pixelateImages
   *          the pixelateImages to set
   */
  public void setPixelateImages( boolean pixelateImages ) {
    this.pixelateImages = pixelateImages;
  }
}

View on GitHub (pinned to f3058517a1)