euroargodev / euroargodev/Coriolis-data-processing-chain-for-Argo-floats-container

Syntax error in docker-decoder-matlab-windows.bat causes Docker Compose command parsing failure

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MATLAB
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Description

While trying to run the MATLAB Dockerized demo on Windows using:

```cmd
.\docker-decoder-matlab-windows.bat 6902892
```

Docker Compose fails immediately with:

```text
'services[decode-float].command' invalid command line string
```

## Root Cause

It looks like there is a small typo in `docker-decoder-matlab-windows.bat`.

The `DECODER_COMMAND` variable is defined with an extra trailing double quote:

```bat
set "DECODER_COMMAND=... 'PROCESS_REMAINING_BUFFERS' '1'""
```

Because of that extra `"`, the value of the environment variable becomes malformed. When Docker Compose expands `${DECODER_COMMAND}` in `compose.yaml`, it fails to parse the command correctly.

## Suggested Fix

Remove the extra trailing quote.

A simpler Windows-safe version could be:

```bat
set "DECODER_COMMAND=/mnt/runtime rsynclog all configfile /mnt/data/config/decoder_conf.json xmlreport co041404_%formattedDateTime%_%FLOAT_WMO%.xml floatwmo %FLOAT_WMO% PROCESS_REMAINING_BUFFERS 1"
```

I tested this locally, and Docker Compose starts successfully after this change.

## Follow-up Observation

After fixing the Windows quoting issue, Docker Compose starts correctly, but I encountered a second failure when using the demo configuration:

```text
/mnt/data/config/decoder_conf.json
```

The decoder fails with:

```text
Input must be a character vector or string scalar.

Line: 35
File: /mnt/runtime/mcr/toolbox/matlab/strfun/str2num.m

Line: 329
File: .../init_config_values.m

Line: 81
File: .../decode_argo_2_nc_rt.m
```

However, the run completed successfully when using the bundled configuration instead:

```text
/app/config/_argo_decoder_conf_ir_sbd.json
```

After some debugging, this seems to be caused by a configuration key mismatch between the demo configuration and the decoder version bundled in the Docker image.

The mounted demo configuration (`decoder_conf.json`) uses:

```json
"TEST015_EXCLUSION_LIST" : "1"
"TEST015_EXCLUSION_LIST_FILE" : "..."
```

However, the decoder inside the Docker image appears to expect the older configuration keys:

```json
"TEST015_GREY_LIST" : "1"
"TEST015_GREY_LIST_FILE" : "..."
```

As a result, `TEST015_GREY_LIST` is never initialized when using the mounted configuration. The decoder later attempts to convert the missing value with `str2num`, which results in:

```text
Input must be a character vector or string scalar.
```

After renaming the configuration keys back to the expected `*_GREY_LIST` names, the decoder proceeds successfully.

I also confirmed that the decoder runs successfully when using the image's bundled configuration:

```text
/app/config/_argo_decoder_conf_ir_sbd.json
```

instead of the mounted demo configuration.

This suggests a compatibility issue between the demo configuration and the decoder image.

## Summary

Based on my testing, there are two separate issues:

1. `docker-decoder-matlab-windows.bat` generates an invalid `DECODER_COMMAND` on Windows because of a quoting error.
2. The demo configuration uses the newer `*_EXCLUSION_LIST` keys, while the decoder bundled in the tested Docker image expects the older `*_GREY_LIST` keys.

## Question

Would you prefer a PR that only fixes the Windows batch script, or one that also updates the demo configuration if the second issue is confirmed?

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.