{"record":{"id":"4af7c28e2e6df008","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-the-transformation-status-in-xml-format","errorCode":null,"errorMessage":"Unable to get the transformation status in XML format","messagePattern":"Unable to get the transformation status in XML format","errorType":"http","errorClass":"ServletException","httpStatus":500,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/www/GetTransStatusServlet.java","lineNumber":312,"sourceCode":"            //\n            transStatus.setPaused( trans.isPaused() );\n\n            // Send the result back as XML\n            //\n            String xml = transStatus.getXML( sendResultXmlWithStatus );\n            data = xml.getBytes( Charset.forName( Const.XML_ENCODING ) );\n            out = response.getOutputStream();\n            response.setContentLength( XML_HEADER.length + data.length );\n            out.write( XML_HEADER );\n            out.write( data );\n            out.flush();\n            if ( finishedOrStopped && ( transStatus.isFinished() || transStatus.isStopped() ) && logId != null && !dontUseCache ) {\n              cache.put( logId, xml, startLineNr );\n            }\n          }\n          response.flushBuffer();\n        } catch ( KettleException e ) {\n          throw new ServletException( \"Unable to get the transformation status in XML format\", e );\n        }\n\n      } else {\n        PrintWriter out = response.getWriter();\n\n        int lastLineNr = KettleLogStore.getLastBufferLineNr();\n        int tableBorder = 0;\n\n        response.setContentType( \"text/html;charset=UTF-8\" );\n\n        out.println( \"<HTML>\" );\n        out.println( \"<HEAD>\" );\n        out.println( \"<TITLE>\"\n          + BaseMessages.getString( PKG, \"TransStatusServlet.KettleTransStatus\" ) + \"</TITLE>\" );\n        if ( EnvUtil.getSystemProperty( Const.KETTLE_CARTE_REFRESH_STATUS, \"N\" ).equalsIgnoreCase( \"Y\" ) ) {\n          out.println( \"<META http-equiv=\\\"Refresh\\\" content=\\\"10;url=\"\n            + convertContextPath( CONTEXT_PATH ) + \"?name=\" + URLEncoder.encode( transName, \"UTF-8\" ) + \"&id=\"\n            + URLEncoder.encode( id, \"UTF-8\" ) + \"\\\">\" );","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/GetTransStatusServlet.java#L294-L330","documentation":"GetTransStatusServlet.doGet wraps any KettleException raised while building the transformation status XML into a ServletException with this message, producing HTTP 500. The underlying exception is attached as the cause.","triggerScenarios":"GET /kettle/transStatus/?name=<trans>&xml=Y where generating the TransStatus XML fails — e.g. log buffer retrieval OOM (see 'Log string is too long'), step status serialization failure, or querying a transformation mid-inconsistent state.","commonSituations":"Monitoring a transformation with a huge log buffer; polling immediately after trans stop where step data is torn down; cache logic storing/rebuilding XML for a finished trans whose log was rotated.","solutions":["Inspect the wrapped cause in the Carte log (often the OOM 'Log string is too long').","Reduce requested log lines or trans logging level; raise heap if OOM.","Retry the request once the transformation is finished/stopped and stable.","Bypass the cache (dontUseCache) if a stale cached XML entry triggers the failure."],"exampleFix":"// before\nString xml = httpGet(\"/kettle/transStatus/?name=mytrans&xml=Y\");\n// after\ntry {\n  String xml = httpGet(\"/kettle/transStatus/?name=mytrans&xml=Y\");\n} catch (HttpServerErrorException e) {\n  trimLogBuffer(\"mytrans\"); retryWithBackoff(\"/kettle/transStatus/?name=mytrans&xml=Y\");\n}","handlingStrategy":"try-catch","validationCode":"// request bounded logs to reduce failure odds\nString url = \"/kettle/transStatus/?name=\" + transName + \"&xml=Y&fromline=\" + lastSeenLine;\nboolean withinLimits = (lastSeenLine >= 0);","typeGuard":null,"tryCatchPattern":"try {\n  String xml = httpGet(url);\n} catch (HttpServerErrorException e) {\n  log.warn(\"transStatus XML failed; cause in server log\");\n  // fall back to HTML status, which avoids XML serialization path\n  String html = httpGet(\"/kettle/transStatus/?name=\" + transName);\n}","preventionTips":["Request log ranges (fromline) rather than the whole buffer.","Keep transformation log levels moderate; cap KettleLogStore buffer.","Avoid polling while the trans is transitioning (stopping/initializing).","Bypass cache when a stale cached XML repeatedly fails."],"tags":["servlet","xml","transformation-status","http-500"],"backgroundTag":"http-error-response","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"}