pentaho/pentaho-kettle · error · KettleException
RegisterPackageServlet.Exception.CopyRequest
RegisterPackageServlet.Exception.CopyRequest
Error message
RegisterPackageServlet.Exception.CopyRequest
What it means
RegisterPackageServlet.copyRequestToDirectory wraps an IOException from reading the servlet request input stream into a KettleException with this message (parameterized with the target directory). It means the uploaded package zip could not be read from the request body.
Solutions
- Check the wrapped IOException cause (connection reset vs. stream closed) in the Carte log.
- Retry the registerPackage upload; ensure the client sends the full body before reading the response.
- Increase client and proxy timeouts for large uploads.
- Verify the client actually streams the zip as the request body (not multipart mismatch) and keeps the connection open.
Example fix
// before
post("/kettle/registerPackage/?dir=/home/admin", zipBytes); // no timeout headroom
// after
post("/kettle/registerPackage/?dir=/home/admin", zipBytes, connectTimeout(30s), writeTimeout(300s)); Defensive patterns
Strategy: retry
Validate before calling
// client: confirm the full body will be sent and connection is keep-alive Request req = new Request.Builder().url(registerPackageUrl) .post(RequestBody.create(zipBytes, "application/zip")).build(); boolean bodyComplete = zipBytes.length == expectedSize; // verify pre-upload
Try / catch
try {
Response r = client.newCall(req).execute();
} catch (IOException e) {
log.warn("upload stream broken, retrying", e);
retryWithBackoff(() -> client.newCall(req).execute(), 3);
} Prevention
- Set generous client timeouts for large uploads.
- Ensure proxies allow long-lived request bodies without idle resets.
- Verify zip size/checksum client-side before upload.
- Retry idempotent uploads on connection resets.
When it happens
Trigger: POST /kettle/registerPackage/ where request.getInputStream() throws IOException — client aborted upload, connection reset mid-transfer, or request body already consumed.
Common situations: Network interruption during large package upload; client timeouts on slow links; proxy/webserver terminating the connection before the body completes.
Related errors
- could not connect to pipedInputStream
- Failed to upload file:
- Invalid Transformation - Missing…
- Not a valid input stream!
- ResourceUtil.Exception.ErrorClosingZipStream
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/96074ad5e4292a22.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/www/RegisterPackageServlet.java:241
* @param folderName
* @return unique temporary directory path.
*/
protected String createTempDirString( String baseDirectory, String folderName ) {
return concat( baseDirectory, folderName );
}
/**
* Copy file specified in <code>request</code> to <code>directory</code>.
* @param request http request with payload.
* @param directory local destination directory.
* @return copied file path.
* @throws KettleException
*/
protected String copyRequestToDirectory( HttpServletRequest request, String directory ) throws KettleException {
try {
return copyRequestToDirectory( request.getInputStream(), directory );
} catch ( IOException ioe ) {
throw new KettleException( BaseMessages.getString( PKG, "RegisterPackageServlet.Exception.CopyRequest", directory ), ioe );
}
}
/**
* Copy contents of <code>inputStream</code> to <code>directory</code>. Expecting zip file.
* @param inputStream zip file input stream.
* @param directory local destination directory.
* @return copied file path.
* @throws KettleException
*/
protected String copyRequestToDirectory( InputStream inputStream, String directory ) throws KettleException {
String copiedFilePath;
try {
FileObject foDirectory = KettleVFS.getInstance( DefaultBowl.getInstance() ).getFileObject( directory );
if ( !foDirectory.exists() ) {
foDirectory.createFolder();
}
FileObject tempZipFile = KettleVFS.getInstance( DefaultBowl.getInstance() )View on GitHub (pinned to f3058517a1)