{"record":{"id":"73966ce40da452c3","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-string-content-of-cell-cell-getcolumnindex","errorCode":null,"errorMessage":"Unable to get string content of cell (\" + cell.getColumnIndex() + \", \" + cell.getRowIndex() + \")","messagePattern":"Unable to get string content of cell \\(\" \\+ cell\\.getColumnIndex\\(\\) \\+ \", \" \\+ cell\\.getRowIndex\\(\\) \\+ \"\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/poi/PoiCell.java","lineNumber":106,"sourceCode":"        case EMPTY:\n        default:\n          return null;\n      }\n    } catch ( Exception e ) {\n      throw new RuntimeException( \"Unable to get value of cell (\"\n        + cell.getColumnIndex() + \", \" + cell.getRowIndex() + \")\", e );\n    }\n  }\n\n  public String getContents() {\n    try {\n      Object value = getValue();\n      if ( value == null ) {\n        return null;\n      }\n      return value.toString();\n    } catch ( Exception e ) {\n      throw new RuntimeException( \"Unable to get string content of cell (\"\n        + cell.getColumnIndex() + \", \" + cell.getRowIndex() + \")\", e );\n    }\n  }\n\n  public int getRow() {\n    Row row = cell.getRow();\n    return row.getRowNum();\n  }\n}\n","sourceCodeStart":88,"sourceCodeEnd":116,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/poi/PoiCell.java#L88-L116","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the cause chain to find the specific POI failure and repair the offending cell in the source file.","Re-save the spreadsheet in Excel or LibreOffice to normalize cell records.","Replace problematic formulas with static values before ingestion.","Catch the RuntimeException per-cell and substitute a default/null so one bad cell does not abort the transformation."],"exampleFix":"// before\nString s = cell.getContents(); // aborts step on bad cell\n// after\nString s;\ntry { s = cell.getContents(); }\ncatch (RuntimeException e) { s = \"\"; log.logMinimal(\"Skipping unreadable cell: \" + e.getMessage()); }","handlingStrategy":"try-catch","validationCode":"String s = null; try { Object v = cell.getValue(); s = (v == null) ? null : v.toString(); } catch (RuntimeException ignored) {}","typeGuard":null,"tryCatchPattern":"try { String s = cell.getContents(); } catch (RuntimeException e) { log.logMinimal(\"Unreadable cell \" + cell.getRow() + \":\" + e.getMessage()); s = \"\"; }","preventionTips":["Wrap per-cell reads so one bad cell does not abort the step","Audit source sheets for formulas and exotic cell types","Normalize files by round-tripping through Excel","Log the cause to diagnose recurring cells/files"],"tags":["poi","spreadsheet","cell-read","runtime-exception"],"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"}