{"record":{"id":"7cca497117195981","repo":"pentaho/pentaho-kettle","slug":"error-retrieving-controlfile-string-orabulkloader","errorCode":null,"errorMessage":"Error retrieving controlfile string","messagePattern":"Error retrieving controlfile string","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoader.java","lineNumber":370,"sourceCode":"        String sqlldr = getFilename( fileObject );\n        sb.append( sqlldr );\n      } catch ( KettleFileException ex ) {\n        throw new KettleException( \"Error retrieving sqlldr string\", ex );\n      }\n    } else {\n      throw new KettleException( \"No sqlldr application specified\" );\n    }\n\n    if ( meta.getControlFile() != null ) {\n      try {\n        FileObject fileObject =\n          getFileObject( meta.getControlFile(), getTransMeta() );\n\n        sb.append( \" control=\\'\" );\n        sb.append( getFilename( fileObject ) );\n        sb.append( \"\\'\" );\n      } catch ( KettleFileException ex ) {\n        throw new KettleException( \"Error retrieving controlfile string\", ex );\n      }\n    } else {\n      throw new KettleException( \"No control file specified\" );\n    }\n\n    if ( OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals( meta.getLoadMethod() ) ) {\n      sb.append( \" data=\\'-\\'\" );\n    }\n\n    if ( meta.getLogFile() != null ) {\n      try {\n        FileObject fileObject =\n          getFileObject( meta.getLogFile(), getTransMeta() );\n\n        sb.append( \" log=\\'\" );\n        sb.append( getFilename( fileObject ) );\n        sb.append( \"\\'\" );\n      } catch ( KettleFileException ex ) {","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoader.java#L352-L388","documentation":"After appending the executable, createCommandLine resolves the control file path via VFS and appends control='<path>' to the sqlldr command. A KettleFileException while resolving or getting the filename of the configured control file is wrapped in this KettleException.","triggerScenarios":"meta.getControlFile() is non-null but getFileObject(meta.getControlFile(), transMeta) or getFilename throws KettleFileException during createCommandLine (execute).","commonSituations":"Control file path contains an unresolvable variable; the path points to a directory or unwritable location; VFS scheme typo; file deleted between generation and command build in concurrent executions.","solutions":["Correct the control file path in the step dialog; ensure the directory exists and is writable.","Resolve/define any environment variables used in the path.","Verify no concurrent execution deletes or moves the generated control file before sqlldr is invoked.","Use a simple absolute path or a valid VFS URL (e.g. file:///tmp/load.ctl)."],"exampleFix":"// before (unresolved variable)\ncontrol file = ${TMPDIR}/load.ctl\n// after\ncontrol file = /tmp/load.ctl","handlingStrategy":"validation","validationCode":"// Java: pre-check the configured control file path\nString ctl = transMeta.environmentSubstitute(meta.getControlFile());\nif (ctl != null) {\n  File dir = new File(ctl).getAbsoluteFile().getParentFile();\n  if (dir == null || !dir.isDirectory() || !dir.canWrite()) {\n    throw new IllegalStateException(\"Control file directory missing/unwritable: \" + dir);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (String.valueOf(e.getMessage()).contains(\"Error retrieving controlfile\")) {\n    // check cause for path/variable resolution failure\n  }\n}","preventionTips":["Use absolute, variable-free paths or ensure variables are defined at runtime.","Avoid concurrent executions sharing the same control file path.","Create target directories during deployment, not at first run."],"tags":["kettle","oracle","control-file","path-resolution"],"backgroundTag":"file-not-found","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"}