Skip to content

Scripts fail when SPOT_REMOTE_NAME contains hyphens

My test instance is named gitlab-latest-v18.

When I try to run detective all the scripts fail with:

[gitlab-latest-v18 gitlab-latest-v18.jfarmiloe-gcp.net:22] run task "20250313_395708 - run check", commands: 1
[gitlab-latest-v18 gitlab-latest-v18.jfarmiloe-gcp.net:22] failed command "Run the check and store result" {script: /bin/sh -c /tmp/.spot-156055511277494112/spot-script1379807952, sudo: true} (1.142s)
[gitlab-latest-v18 gitlab-latest-v18.jfarmiloe-gcp.net:22] completed task "20250313_395708 - run check", commands: 0 (1.485s)

I have traced this to the use of the {SPOT_REMOTE_NAME} in the JSON_DATA_ variable name. Hyphens in bash variable names are problematic and in this case cause the scripts to fail with errors similar to:

line 51: JSON_DATA_20250423_8082_all_gitlab-latest-v18={: command not found
Edited by Justin Farmiloe