Error Message: ‘The handle is invalid’


This error message might occur with any of the tools like Updater, Merger, … from the ASAP2 Tool-Set. Here is an example using the Updater:

  • Batch file content:

    @echo off
    set path=tools;D:\ProgramFiles\ASAP2Toolset\11.0\Exec
    make Generate_a2l -f makefile 2>&1 | tools\mtee.exe /t/+ buildlog.log

  • Makefile content:

    .PHONY: build_a2l
    build_a2l: Generate_a2l

    ASAP2Updater -I Demo.a2l -A demo.MAP -O test_makefile_v11.a2l -T Updater.ini -L test_makefile_v11.log


After executing the batch file, the log file buildlog.log contains the following error:

<ERROR> The handle is invalid.

Without the command 2>&1 | no error is written to the log file.


The progress view needs to be deactivated. This can be done by adding the following line to the section [options] in your UPDATER.INI file:



The issue is caused by position controlled outputs in the console. These commands are used for the progress view into the console. The ASAP2-Toolset writes the progress view into the console (0%... 100%). To write this progress view the cursor of the console has to be positioned to the beginning every time the progress view is updated. 

For example the progress view has the value 50% at the moment. Now, the progress view changes to 56%, but the 56% should be written at the same position as the 50% were written before (and not after the 50%). So the cursor has to be positioned to the beginning of the 50% and then the 50% is overwritten with 56%. The STDOUT is redirected by the command 2>&1| to the Mtee.exe tool and this results into issues in combination with position controlled outputs.

This issue might occur for any cases where the standard output (console) is somehow forwarded to other tools/applications. This is for instance the case if MATLAB is used in this context.

Article ID: 830
Last updated: 2019-05-06
Revision: 7
ASAP2 Tool-Set -> Troubleshooting -> Error Message: ‘The handle is invalid’