---
title: "Troubleshooting"
description: "Fix problems of LumiScan Script Runner: installer and start, HALCON release and licence, procedures that do not load, interface changes and failed runs."
product: "LumiScan Script Runner"
component: "lumiscan-script-runner"
version: "1.0.0"
display_version: "1.0.0.2"
latest_version: true
language: "en"
url: "https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html"
---

# Troubleshooting – LumiScan Script Runner

This page describes problems of LumiScan Script Runner. Start with the [general checks](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#general-checks), then find your symptom below: each problem lists its symptoms, the possible causes, a diagnostic procedure and the resolution. The status codes are listed in [Status Codes](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/status-codes.html).

## General checks {#general-checks}

1. **Check the app.** Read `hdvisionsystems/lumiscan-script-runner/v1/system/status-text`. Expected: `Initialized`.
2. **Check HALCON.** Read `v1/system/engine/license-valid` and `v1/system/engine/version`. Expected: `true` and the HALCON version.
3. **Check the module.** Read `v1/<module>/status/code` and `status/text`. Expected: `0` and `ready`.
4. **Check the last run.** Read `v1/<module>/run/output/status-code` and `status-text`. Expected: `0`.
5. **Read the log.** The Script Runner writes its log to its console window. At start it names the script folder, every procedure it loaded with its interface hash, every module with its group, and every module it did not build, with the reason.

The settings folder is listed under [Settings Folder](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/settings-folder.html#location).

## Installation {#ts-installation}

### Problem: The installer says HALCON was not found {#ts-installer-halcon}

**Symptoms**

The installer stops before installing anything with the message *LumiScan Script Runner needs MVTec HALCON 22.11 (Steady) with a runtime licence, and HALCON was not found*. The message continues with one of two reasons: *the system environment variable HALCONROOT is not set*, or *no bin\\x64-win64\\halcon.dll in the HALCONROOT folder*.

**Possible causes**

- HALCON is not installed.
- HALCON was installed for the current user only. That sets `HALCONROOT` as a user variable, and the installer reads only the system variable.
- `HALCONROOT` names a folder without `bin\x64-win64\halcon.dll`, for example after HALCON was moved or partly uninstalled, or it is the 32-bit or another platform’s installation.

**Diagnostic procedure**

1. Open **Edit the system environment variables** in Windows, then **Environment Variables**. Look for `HALCONROOT` under **System variables** (not under the user variables).
2. Check that `bin\x64-win64\halcon.dll` exists in the folder it names, for example `C:\Program Files\MVTec\HALCON-22.11-Steady\bin\x64-win64\halcon.dll`.
3. If needed, read the installer’s log: it is written to the `%TEMP%` folder as `LumiScan_Script_Runner_<date and time>.log`, and the lines `File search` and `Condition` show what was looked for.

**Resolution**

- **If HALCON is missing, or installed for one user only:** install HALCON 22.11 for all users, sign out and in again, and run the Script Runner installer again.
- **If the folder is wrong:** repair the HALCON installation so that `HALCONROOT` names it and `halcon.dll` is there.

**If the problem persists**

Send the installer’s log and the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support.

## Start {#ts-start}

### Problem: The app stops right after it starts {#ts-app-does-not-start}

**Symptoms**

The console window shows an error and closes, or no node appears under `hdvisionsystems/lumiscan-script-runner`.

**Possible causes**

- The application file is not valid JSON, or a setting is refused: `apiVersion` is not `1`, `scriptFolder` is empty, `engine.threadNum` is not a whole number from 0 to 1024, a module entry is refused, or two modules have the same name. See [Application File](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/application-file.html), section *Checks at start*.
- The app cannot reach LumiScan Keryx.
- HDevEngine cannot be set up, for example because HALCON is not installed or its library folder is not on `PATH` (Windows) or `LD_LIBRARY_PATH` (Ubuntu).
- HALCON of another release than 22.11 is loaded, see [Problem: The app stops with "HALCON of another release is loaded"](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#ts-halcon-release).

**Diagnostic procedure**

1. Start the app from a command prompt (Windows: `lumiscan-script-runner.exe` in its installation folder) or a terminal (Ubuntu: `lumiscan-script-runner`) to keep the log on screen.
2. Look for lines starting with `[ScriptRunner] Cannot start`, `HDevEngine cannot be set up` or an error about the Data Layer connection. A refused module entry is logged as `module <name>: …`.
3. Open `lumiscan-script-runner.json` in an editor that checks it against its schema, for example Visual Studio Code.

**Resolution**

- **If the application file is refused:** correct the setting the log names, see [Application File](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/application-file.html). If in doubt, rename the file: the next start copies the shipped default.
- **If LumiScan Keryx is not reachable:** start LumiScan Keryx first, or give the broker with `--keryx-url`.
- **If HDevEngine cannot be set up:** install HALCON 22.11. On Windows, check `%HALCONROOT%\bin\x64-win64\halcon.dll`, and sign in again so that `PATH` is updated. On Ubuntu, check `$HALCONROOT/lib/x64-linux/libhalcon.so`, and that `LD_LIBRARY_PATH` names its folder in the terminal that starts the app.

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support.

### Problem: The app stops with "HALCON of another release is loaded" {#ts-halcon-release}

**Symptoms**

The app stops right after it starts. The log has a line starting with `[ScriptRunner] HDevEngine cannot be set up: HALCON of another release is loaded:`, followed by each HALCON library of the wrong release with its version and folder, for example `halcon.dll 24.11.1.0 (C:\Program Files\MVTec\HALCON-24.11-Steady\bin\x64-win64\halcon.dll)`. On Ubuntu the libraries are `libhalcon.so`, `libhalconcpp.so` and `libhdevenginecpp.so`.

**Possible causes**

- Only another HALCON release is installed, for example 24.11 instead of 22.11.
- HALCON 22.11 and another release are both installed, and the other release’s library folder comes first: `bin\x64-win64` on `PATH` (Windows), `lib/x64-linux` on `LD_LIBRARY_PATH` (Ubuntu).
- A HALCON library of another release was copied into the Script Runner’s installation folder.

**Diagnostic procedure**

1. Read the folders the log line names: they show which HALCON installation was used.
2. On Windows, run `where halcon.dll` in a command prompt: the first line is the library the Script Runner loads. On Ubuntu, run `echo $LD_LIBRARY_PATH` in the terminal that starts the app: the first HALCON folder in it is the one the Script Runner uses.
3. Check `HALCONROOT`: on Windows under the **System variables**, on Ubuntu with `echo $HALCONROOT`. It should name the HALCON 22.11 folder.

**Resolution**

- **If HALCON 22.11 is not installed:** install it, with a licence valid for 22.11 (on Windows for all users). It can stay installed next to the other release.
- **If another release comes first:** on Windows, move `%HALCONROOT%\bin\x64-win64` of HALCON 22.11 above the other release’s folder in the system variable `PATH`, or remove the other folder from `PATH`. On Ubuntu, put `$HALCONROOT/lib/x64-linux` of HALCON 22.11 before the other release’s folder in `LD_LIBRARY_PATH`, for example in `~/.profile`. Sign out and in again, then start the app.
- **If a HALCON library is in the installation folder:** delete it there; the Script Runner never ships HALCON’s libraries.
- **If you have to use the newer HALCON release:** you need a version of the Script Runner built for it. Contact HD Vision Systems.

**If the problem persists**

Send the log line and the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support.

### Problem: Every module reports `-4` {#ts-licence}

**Symptoms**

`v1/<module>/status/code` is `-4` for every module. `v1/system/engine/license-valid` is `false`; `v1/system/status-text` says `the HALCON licence is not valid: …`.

**Possible causes**

- No valid HALCON runtime licence on the PC: the HALCON dongle is not plugged in, or the licence file is missing or expired.
- The HALCON dongle was pulled while the app ran. HALCON notices it after 2 to 4 minutes; from then on runs fail with `-4`.

**Diagnostic procedure**

1. Read `v1/system/licenses/current/error-text`. It holds HALCON’s own licence message.
2. Read `v1/system/licenses/current/file` and `host-id`: the licence file HALCON chose and the PC or dongle it is bound to. `v1/system/licenses/files` lists every licence file HALCON found.
3. Check that the HALCON dongle is plugged in, or that the licence file is in HALCON’s licence folder.

**Resolution**

- Plug in the HALCON dongle or install the licence file, then restart the app. The Script Runner checks HALCON’s licence at start; after a licence error it reports `-4` until it is restarted.

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support, together with `v1/system/status-text`. For licences, contact [licenses@hdvisionsystems.com](mailto:licenses@hdvisionsystems.com).

### Problem: One module reports `-4`, the others run {#ts-halcon-module}

**Symptoms**

`v1/<module>/status/code` is `-4` for one module; `status/text` names a HALCON module, for example `matching`.

**Possible causes**

- The procedure needs a HALCON module that the HALCON licence does not cover. The modules it needs come from `requiredModules` of its interface file.

**Diagnostic procedure**

1. Read `v1/system/engine/licensed-modules`. Expected: it contains the module named in `status/text`.

**Resolution**

- Extend the HALCON licence, or change the procedure so that it does without the module. If `requiredModules` in the interface file lists a module the procedure does not really need, correct the list and restart the app.

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support, together with `v1/system/engine/licensed-modules` and the interface file.

## Modules {#ts-modules}

### Problem: A module reports `-10002` (script not loaded) {#ts-script-not-loaded}

**Symptoms**

`v1/<module>/status/code` is `-10002`; the module has no input or output nodes.

**Possible causes**

- No procedure file of that name in the script folder (`procedure` names the file without `.hdvp`).
- HDevEngine cannot load the procedure, for example because it was saved with a newer HALCON version.
- A parameter has no type: neither the documentation nor an interface file gives one.
- The interface file does not fit the procedure: a parameter is missing on one side, renamed, in another group or of another dimension.
- A parameter cannot be on a node: a handle input without a store binding, a region or contour input, a vector, or strings mixed with numbers.
- A binding names a parameter the procedure does not have, binds it in the wrong direction, or gives an image, a handle or a value that does not fit a fixed value.
- Two parameters give the same node name, or an output gives a reserved name (`status-code`, `status-text`, `package-identifier`).
- The module is a `start` module, and its run failed.

**Diagnostic procedure**

1. Read `v1/<module>/status/text`. It names the parameter and the reason.
2. Read `v1/system/scripts`. Expected: the procedure is listed without `error`.
3. Read the log of the start: it lists every warning and refusal per parameter.

**Resolution**

- **If the procedure is missing:** copy it into the script folder, or correct `procedure` in the application file.
- **If a parameter has no type:** document it in HDevelop or add it to the interface file, see [Prepare a HALCON Procedure](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/how-tos/prepare-a-procedure.html).
- **If the interface file does not fit:** correct it, see [Interface File](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/interface-file.html).
- **If a parameter cannot be on a node:** bind it to the store or a fixed value, or change the procedure, see [Type Mapping](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/type-mapping.html).
- **If a start run failed:** the text gives the HALCON error; correct the procedure or the file it reads.

Then restart the app. Expected: `status/code` is `-10005` (for a new module) or `0`.

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support, together with `status/text`, the procedure and its interface file.

### Problem: A module reports `-10005` (interface changed) {#ts-interface-changed}

**Symptoms**

`v1/<module>/status/code` is `-10005`; the module has no input or output nodes and accepts no request. `status/text` says that the module has no accepted interface hash, or that the procedure’s interface changed (`accepted sha256:…, now sha256:…`).

**Possible causes**

- The module is new and has no `acceptedInterfaceHash` yet.
- The procedure or its interface file was replaced, and a parameter was added, removed, renamed, moved to another group or retyped.

**Diagnostic procedure**

1. Read `v1/<module>/status/text`. It gives the accepted and the current hash.
2. Compare `v1/<module>/script/interface` with the interface your PLC program expects.

**Resolution**

- **If the change is wanted:** adapt your PLC program, copy `v1/<module>/script/interface-hash` into `acceptedInterfaceHash` and restart the app. See [Add a Module](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/how-tos/add-a-module.html) and [Replace a Script](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/how-tos/replace-a-script.html). For a procedure whose types come from an interface file, `interface-save` sets the hash for you, see [Building one over the Data Layer](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/interface-file.html#over-the-data-layer).
- **If the change is not wanted:** put the previous procedure back into the script folder and restart the app.

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support, together with `status/text` and `script/interface`.

### Problem: Every module reports `-5` (restart required) {#ts-restart-required}

**Symptoms**

`v1/system/restart-required` is `true`; every module reports `-5`, and no request is accepted.

**Possible causes**

- `v1/system/settings` was written. The new settings are saved, and take effect at the next start.
- An interface file was saved with `interface-save`. The app loads it at the next start.

**Resolution**

- Restart the app.

## Runs {#ts-runs}

### Problem: The module does not react to `request` {#ts-not-acknowledged}

**Symptoms**

`run/request` is `true`, but `run/running` stays `false`.

**Possible causes**

- `run/ready` was `false` when `request` rose: the module is not built, a restart is pending, a run is still going on, or `request` was not lowered after the previous run.
- `request` was already `true` and was not lowered after the previous run: the run starts on the rising edge only.

**Diagnostic procedure**

1. Read `run/ready` and `status/code` of the module.
2. Check that your program lowers `request` after every run and waits for `ready` before it raises it again.

**Resolution**

- **If `status/code` is not `0`:** follow the entry for that code.
- **If `request` was not lowered:** lower it, wait for `ready`, raise it again. See [The run Handshake](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/run-handshake.html).

### Problem: A run ends with `-3` (invalid input) {#ts-invalid-input}

**Symptoms**

`has-error` is `true`; `run/output/status-code` is `-3`. The procedure did not run.

**Possible causes**

- A number is outside the parameter’s min and max.
- An input image has an unknown pixel type, width or height 0, a `data` size that does not match width × height × bytes per pixel, or a pixel type or channel count the parameter does not accept.
- A handle taken from the group’s store is no longer valid, or of another kind than the interface declares.

**Diagnostic procedure**

1. Read `run/output/status-text`. It names the input and the reason.
2. For a number, read the node’s description: it ends with min and max.
3. For an image, compare `pixel-type`, `width`, `height` and the size of `data`.

**Resolution**

- Correct the input and run again. For a handle, run the module that writes the store key again (or restart the app to rerun the `start` modules).

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support, together with `status-text` and the input values.

### Problem: A run ends with `-10001` (script error) {#ts-script-error}

**Symptoms**

`has-error` is `true`; `run/output/status-code` is `-10001`.

**Possible causes**

- The procedure raised an error with `throw`.
- A HALCON operator failed inside the procedure, for example because a file is missing or an input made no sense to it.
- The procedure opened or asked for a window (`dev_open_window`, `dev_get_window`): the Script Runner has no display.

**Diagnostic procedure**

1. Read `run/output/status-text`. It names the procedure (or sub-procedure), the program line, the HALCON error number and the message.
2. Run the procedure in HDevelop with the same inputs.

**Resolution**

- Correct the input or the procedure. Remove window operators from the procedure. A file the procedure reads must be in the script folder.

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support, together with `status-text`, the input values and the procedure.

### Problem: A run ends with `-10003` (output type mismatch) {#ts-output-mismatch}

**Symptoms**

`has-error` is `true`; `run/output/status-code` is `-10003`. No output was written.

**Possible causes**

- The procedure returned an output of another type than declared, for example a string for an integer, several values for a single-value parameter, or an image of a pixel type that is not carried.
- The procedure did not set an output on the path it took.

**Diagnostic procedure**

1. Read `run/output/status-text`. It names the parameter, the declared and the returned type.

**Resolution**

- Correct the procedure so that every output is set on every path and matches its declared type, or correct the declared type. For images, convert to `byte` or `uint2` before `return ()`.

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support, together with `status-text` and the procedure.

### Problem: A run ends with `-10004` (store value missing) {#ts-store-value-missing}

**Symptoms**

`has-error` is `true`; `run/output/status-code` is `-10004`.

**Possible causes**

- The module that writes the store key has not run successfully yet: the `start` module failed, or the handshake module that writes the key was not called.
- The writing module is in another group: each group has its own store.
- The key names differ between the writing and the reading binding.

**Diagnostic procedure**

1. Read `run/output/status-text`. It names the key and the modules that write it.
2. Read `v1/system/groups`. Expected: the key is listed in the group’s store.
3. Compare `setting/group` and `setting/bindings` of both modules.

**Resolution**

- Run the writing module first, or correct the `start` module (`status/code` `-10002` shows why it failed).
- Put both modules into the same group, and use the same key, see [Share a Model Between Scripts](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/how-tos/share-a-model-between-scripts.html).

**If the problem persists**

Send the information listed under [Information for support](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/troubleshooting.html#support-information) to support, together with `status-text`, `v1/system/groups` and the application file.

### Problem: Runs are slow or wait long {#ts-slow}

**Symptoms**

`running` stays `true` much longer than the procedure needs in HDevelop.

**Possible causes**

- Another module of the same group runs: requests in one group wait for each other.
- HALCON may use one thread per operator only (`engine.threadNum` `1`, the default).
- Large images: every image input and output is copied into and out of HALCON, for a 5-megapixel `rgb8` frame about 13 to 27 ms per direction, see [Copy time](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/type-mapping.html#image-copy-time).

**Diagnostic procedure**

1. Read `setting/group` of the modules. Expected: only modules that share store keys are in one group.
2. Compare the run time with the size and pixel type of the images the module takes and returns.

**Resolution**

- Put modules without shared state into groups of their own: they run in parallel.
- If the PC has cores to spare, raise `engine.threadNum`, or try `engine.jitCompiled`. See [engine](https://docs.hdvisionsystems.com/en/lumiscan-script-runner/application-file.html#engine).
- Pass only the images the procedure needs, prefer `mono8` where it is enough, and leave an image output off the Data Layer (`{"to": "none"}`) when no client reads it.

## Information for support {#support-information}

If a problem persists, send this information to support:

- **Software version:** the version of LumiScan Script Runner, shown in the log at start (`Version: …`), the HALCON version (`v1/system/engine/version`) and the licence in use (`v1/system/licenses/current/file`, `type`, `host-id`).
- **Platform:** Windows 11 or Ubuntu 24.04, and the exact version of the operating system.
- **Log:** the console output of the app from its start to the error.
- **Time:** the date and time of the error.
- **Communication status:** `status/code` and `status/text` of the module, `run/output/status-code` and `run/output/status-text` of the last run, and `v1/system/status-text`.
- **Files:** `lumiscan-script-runner.json` and the procedure with its interface file, if you may share them. A protected procedure is fine.

Contact HD Vision Systems customer success at [customer.success@hdvisionsystems.com](mailto:customer.success@hdvisionsystems.com) or +49 6221 6721905; for licences, [licenses@hdvisionsystems.com](mailto:licenses@hdvisionsystems.com).
