pentaho/pentaho-kettle · error · RuntimeException

Unable to get string content of cell (" +…

Error message

Unable to get string content of cell (" + cell.getColumnIndex() + ", " + cell.getRowIndex() + ")

What it means

PoiCell.getContents() calls getValue() to obtain the cell value and wraps any Exception in a RuntimeException that includes the cell's column and row indices. Because it delegates to getValue(), any POI-level failure reading the cell (formula evaluation, type mismatch) surfaces here as well.

Solutions

  1. Inspect the cause chain to find the specific POI failure and repair the offending cell in the source file.
  2. Re-save the spreadsheet in Excel or LibreOffice to normalize cell records.
  3. Replace problematic formulas with static values before ingestion.
  4. Catch the RuntimeException per-cell and substitute a default/null so one bad cell does not abort the transformation.

Example fix

// before
String s = cell.getContents(); // aborts step on bad cell
// after
String s;
try { s = cell.getContents(); }
catch (RuntimeException e) { s = ""; log.logMinimal("Skipping unreadable cell: " + e.getMessage()); }
Defensive patterns

Strategy: try-catch

Validate before calling

String s = null; try { Object v = cell.getValue(); s = (v == null) ? null : v.toString(); } catch (RuntimeException ignored) {}

Try / catch

try { String s = cell.getContents(); } catch (RuntimeException e) { log.logMinimal("Unreadable cell " + cell.getRow() + ":" + e.getMessage()); s = ""; }

Prevention

When it happens

Trigger: Calling getContents() on a PoiCell when the underlying getValue() throws — formula cells that cannot be evaluated, corrupted cell records, or inconsistent cell-type metadata in the workbook.

Common situations: Excel Input step reading sheets with complex formulas or exotic cell types; files exported by non-Excel tools with malformed cell records; POI version incompatibilities.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/poi/PoiCell.java:106

        case EMPTY:
        default:
          return null;
      }
    } catch ( Exception e ) {
      throw new RuntimeException( "Unable to get value of cell ("
        + cell.getColumnIndex() + ", " + cell.getRowIndex() + ")", e );
    }
  }

  public String getContents() {
    try {
      Object value = getValue();
      if ( value == null ) {
        return null;
      }
      return value.toString();
    } catch ( Exception e ) {
      throw new RuntimeException( "Unable to get string content of cell ("
        + cell.getColumnIndex() + ", " + cell.getRowIndex() + ")", e );
    }
  }

  public int getRow() {
    Row row = cell.getRow();
    return row.getRowNum();
  }
}

View on GitHub (pinned to f3058517a1)