{"record":{"id":"bb99dd04461e8aca","repo":"pentaho/pentaho-kettle","slug":"unable-to-serialize-step-0-status-data-to-xml","errorCode":null,"errorMessage":"Unable to serialize step '{0}' status data to XML","messagePattern":"Unable to serialize step '(.+?)' status data to XML","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/StepStatus.java","lineNumber":157,"sourceCode":"        xml.append( sampleRowMeta.getMetaXML() );\n        xml.append( Const.CR );\n        if ( sampleRows != null ) {\n          synchronized ( sampleRows ) {\n            Iterator<Object[]> iterator = sampleRows.iterator();\n            while ( iterator.hasNext() ) {\n              Object[] sampleRow = iterator.next();\n              xml.append( sampleRowMeta.getDataXML( sampleRow ) );\n              xml.append( Const.CR );\n            }\n          }\n        }\n        xml.append( XMLHandler.closeTag( \"samples\" ) );\n      }\n\n      xml.append( XMLHandler.closeTag( XML_TAG ) );\n      return xml.toString();\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to serialize step '\" + stepname + \"' status data to XML\", e );\n    }\n  }\n\n  public StepStatus( Node node ) throws KettleException {\n    stepname = XMLHandler.getTagValue( node, \"stepname\" );\n    copy = Integer.parseInt( XMLHandler.getTagValue( node, \"copy\" ) );\n    linesRead = Long.parseLong( XMLHandler.getTagValue( node, \"linesRead\" ) );\n    linesWritten = Long.parseLong( XMLHandler.getTagValue( node, \"linesWritten\" ) );\n    linesInput = Long.parseLong( XMLHandler.getTagValue( node, \"linesInput\" ) );\n    linesOutput = Long.parseLong( XMLHandler.getTagValue( node, \"linesOutput\" ) );\n    linesUpdated = Long.parseLong( XMLHandler.getTagValue( node, \"linesUpdated\" ) );\n    linesRejected = Long.parseLong( XMLHandler.getTagValue( node, \"linesRejected\" ) );\n    errors = Long.parseLong( XMLHandler.getTagValue( node, \"errors\" ) );\n    statusDescription = XMLHandler.getTagValue( node, \"statusDescription\" );\n    seconds = Double.parseDouble( XMLHandler.getTagValue( node, \"seconds\" ) );\n    speed = XMLHandler.getTagValue( node, \"speed\" );\n    priority = XMLHandler.getTagValue( node, \"priority\" );\n    stopped = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( node, \"stopped\" ) );","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/StepStatus.java#L139-L175","documentation":"KettleException thrown by StepStatus.getXML() when serializing a step's runtime status (metrics, samples) to XML fails. Any exception during XMLHandler tag building — e.g. from generating sample row data or number formatting — is wrapped in this message naming the failing step.","triggerScenarios":"getXML() on a StepStatus where building the XML fragment throws: parsing sample rows for XML output fails, I/O-style errors in XMLHandler.appendRepr, or null/invalid internal status fields producing exceptions during string building.","commonSituations":"Monitoring/monitoring-socket (trans status servlet) usage where a step's sample rows contain characters or data that break XML serialization; remote status polling of running transformations on a Carte server.","solutions":["Inspect the chained cause to find which status field/sample row fails to serialize","Check step sample rows for characters that break XML encoding (invalid control chars) and sanitize input data","Update Pentaho/Kettle — older versions had XML-encoding edge cases in status servlets","Retry status retrieval; if persistent, restart the transformation to reset corrupted step status state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check sample rows for XML-hostile characters before building status\nfor (String sample : stepStatus.getSample()) {\n  if (sample != null && sample.matches(\".*[\\\\x00-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F].*\")) {\n    log.warn(\"Sample contains control characters that may break XML serialization\");\n  }\n}","typeGuard":"boolean isXmlSafe(String s) {\n  return s == null || !s.matches(\".*[\\\\x00-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F].*\");\n}","tryCatchPattern":"try {\n  String xml = stepStatus.getXML();\n} catch (KettleException e) {\n  log.error(\"Status serialization failed for step '\" + stepName + \"': \" + e.getMessage(), e);\n  // fall back to a minimal status without samples\n  stepStatus.setSample(new String[0]);\n  xml = stepStatus.getXML();\n}","preventionTips":["Sanitize/reject input rows containing control characters","Keep Kettle updated for XML-encoding fixes in the status servlet","Limit sample size in monitoring configuration"],"tags":["serialization","xml","monitoring"],"backgroundTag":"json-serialization-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"}