{"record":{"id":"86f6058de7ede167","repo":"pentaho/pentaho-kettle","slug":"unable-to-convert-file","errorCode":null,"errorMessage":"Unable to convert file '","messagePattern":"Unable to convert file '","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/dostounix/JobEntryDosToUnix.java","lineNumber":696,"sourceCode":"        updateBadFormed();\n        if ( resultfilenames.equals( ADD_ALL_FILENAMES ) || resultfilenames.equals( ADD_ERROR_FILES_ONLY ) ) {\n          addFileToResultFilenames( file, result, parentJob );\n        }\n      } else {\n        if ( isDetailed() ) {\n          logDetailed( \"---------------------------\" );\n          logDetailed( BaseMessages.getString( PKG, \"JobDosToUnix.Error.FileConverted\", file, convertToUnix\n            ? \"UNIX\" : \"DOS\" ) );\n        }\n        // Update processed files number\n        updateProcessedFormed();\n        if ( resultfilenames.equals( ADD_ALL_FILENAMES ) || resultfilenames.equals( ADD_PROCESSED_FILES_ONLY ) ) {\n          addFileToResultFilenames( file, result, parentJob );\n        }\n      }\n\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to convert file '\" + file.toString() + \"'\", e );\n    }\n    return retval;\n  }\n\n  private void updateProcessedFormed() {\n    nrProcessedFiles++;\n  }\n\n  private void updateBadFormed() {\n    nrErrorFiles++;\n    updateAllErrors();\n  }\n\n  private void addFileToResultFilenames( FileObject fileaddentry, Result result, Job parentJob ) {\n    try {\n      ResultFile resultFile =\n        new ResultFile( ResultFile.FILE_TYPE_GENERAL, fileaddentry, parentJob.getJobname(), toString() );\n      result.getResultFiles().put( resultFile.getFile().toString(), resultFile );","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/dostounix/JobEntryDosToUnix.java#L678-L714","documentation":"JobEntryDosToUnix wraps any Exception thrown while converting a file's line endings (DOS CRLF to Unix LF) in a KettleException with the message 'Unable to convert file <path>'. The underlying cause (e.g. an IOException while reading/writing, or an error while adding the file to the result filenames list) is attached as the cause. It signals the dos-to-unix job entry failed to process one specific file and the entry's execute() aborts.","triggerScenarios":"Calling execute() on a JobEntryDosToUnix whose configured file/folder/wildcard selection matches a file that cannot be read, written, or whose addFileToResultFilenames call throws; the try block around convert() catches Exception and rethrows at this line.","commonSituations":"File does not exist or is locked by another process; insufficient read/write permissions on the target file or directory; the file is a directory or a special file; disk full while writing the converted file; result-filename configuration referencing ADD_ALL_FILENAMES/ADD_PROCESSED_FILES_ONLY with an inaccessible result file.","solutions":["Inspect the chained cause exception (e.getCause()) to find the real I/O failure and its file path.","Verify the file exists, is a regular file, and the Pentaho process user has read/write permission on it.","Check disk space and that the file is not locked/open exclusively by another process.","Correct the file/folder/wildcard settings in the job entry so only valid target files are selected.","If 'add file to result' is enabled, ensure the result filenames configuration is valid."],"exampleFix":"// before\njobEntry.execute(prevResult, 0); // throws KettleException 'Unable to convert file ...'\n// after\nFile f = new File(path);\nif (f.isFile() && f.canRead() && f.canWrite()) {\n  jobEntry.execute(prevResult, 0);\n} else {\n  logError(\"Skipping non-writable file: \" + path);\n}","handlingStrategy":"try-catch","validationCode":"File f = new File(path);\nif (!f.isFile() || !f.canRead() || !f.canWrite()) {\n  throw new IllegalStateException(\"File not readable/writable: \" + path);\n}\nif (f.getUsableSpace() < f.length() * 2) {\n  throw new IllegalStateException(\"Insufficient disk space for conversion\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  result = dosToUnixEntry.execute(prevResult, 0);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  logError(\"DosToUnix failed for file: \" + cause.getMessage(), e);\n  result.setResult(false);\n}","preventionTips":["Pre-check that each matched file is a regular file with read/write permissions before running the entry.","Run the Kettle process under an account with rights on the target directories.","Monitor disk space on volumes holding the converted files.","Restrict wildcards so locked/system files are not selected."],"tags":["file-io","job-entry","line-endings","kettle"],"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"}