Exit Code 255 Conversion Error and IOException with KFXConverter Log With Multiple KIC Instances

ISSUE


Documents are failing to import into KIC with document conversion errors. Oftentimes, this is due to issues with secure PDFs or other unsupported files or even due to some missing files that can be restored by reinstalling Visual C++ Redistributable for Visual Studio 2015 from the prerequisites. However, if you are running v2.8, this issue can also occur when configured to run multiple instances in the KIC Plugin.


If you review the KFXConverter logs you will see the error the following errors.


02/16:51:02.859 (322c/42d8/0082) {"ConsoleOutputWrite"} Unhandled Exception: System.IO.IOException: The process cannot access the file '
02/16:51:02.859 (322c/42d8/0082) {"ConsoleOutputWrite"} C:\ProgramData\Kofax\KFXConverter\KFXConverter.log' because it is being used by
02/16:51:02.859 (322c/42d8/0082) {"ConsoleOutputWrite"} another process.
02/16:51:02.859 (322c/42d8/0082) {"ConsoleOutputWrite"}    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
02/16:51:02.859 (322c/42d8/0082) {"ConsoleOutputWrite"}    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access,

These errors are occurring due to the multiple instances stepping on top of each other as the conversion processes open/close the KFXConverter log. We have also seen this sometimes occur even running a single instance.


SOLUTION


* This is a bug that, as of this writing, is slated to be fixed in v2.9. If 2.9 is available, please upgrade to 2.9 to resolve. If 2.9 is not available, or for those that are unable to upgrade to 2.9, below is a workaround that will resolve the issue in the meantime.


The solution entails creating a new log file for each KfxConverter instance in each MC instance. The KFXConverter.bat script file in each MC instance folder can be modified to append Date/Time to KfxConverter log file.


Please follow the steps below to create a new log file and edit the log file scripting:

  • Before making any changes to the script file, open a command prompt and run below command:
echo "C:\ProgramData\Kofax\KFXConverter\KFXConverter_MC01_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%.log"
    • The output should look like the following:
C:\ProgramData\Kofax\KFXConverter\KFXConverter_MC01_20200907_17584181.log.
    • Then, open the following file to modify it:
C:\Program Files (x86)\Kofax\KIC-ED\MC\Scripts\KFXConverter.bat
    • Add the below two lines just before the “ECHO Calling KFXConverter (%CD%)” line
set logFile="C:\ProgramData\Kofax\KFXConverter\KFXConverter_MC01_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%.log"
del /Q C:\ProgramData\Kofax\KFXConverter\KFXConverter_MC01*.log
    • Note: if you don't call the delete command (i.e., "del") then the folder will get piled up with a large number of KfxConverterxxx.log files. However, if you wish to retain log files for some reason, just add "REM" before the del command as shown below:
REM del /Q C:\ProgramData\Kofax\KFXConverter\KFXConverter_MC01*.log
    • IMPORTANT: If you have a C:\Program Files (x86)\Kofax\KIC-ED\MC02 or MC03 folder, please follow the above steps for the KFXConverter.bat file in those directories as well.