Skip to content

setup.sh fails with Debian yq and does not generate certificates #5216

Description

@senthalan

Description

I believe this issue could affect quite a few users, especially those installing ThunderID on Debian- or Ubuntu-based systems. Since these distributions may provide a different yq implementation than the one expected by setup.sh, users can run into this problem even when they have installed all seemingly required dependencies.

I found an issue with setup.sh in ThunderID 1.0.1 on Debian.

The setup script detects yq using:

if command -v yq >/dev/null 2>&1; then
and then executes commands such as:

yq eval '.server.hostname // "localhost"' deployment.yaml
The problem is that Debian can provide a different yq implementation which does not support the yq eval syntax expected by the script.

Because setup.sh also uses:

set -e
the script exits immediately when that yq command fails.

As a result, it never reaches:

configure_direct_auth_secret
configure_certificates
and files such as the following are not generated:

config/certs/server.cert
config/certs/server.key
config/certs/signing.cert
config/certs/signing.key
config/certs/ecdsa-signing.cert
config/certs/ecdsa-signing.key
config/certs/crypto.key
config/secrets/direct_auth_secret
The startup then fails with errors such as:

Failed to initialize certificate service
certificate file not found at .../config/certs/signing.cert
I confirmed the failure with bash -x ./setup.sh --verbose. The trace stops around:

  • command -v yq
    ++ yq eval '.server.hostname // "localhost"' ./deployment.yaml
  • HOSTNAME=
    A possible fix would be to check whether the installed yq actually supports the required syntax before using it, for example:

if command -v yq >/dev/null 2>&1 &&
yq eval '.' /dev/null >/dev/null 2>&1; then
and otherwise use the existing grep/awk fallback.

Alternatively, the setup script could explicitly check for Mike Farah's yq v4 and provide a clear error message if an incompatible implementation is installed.

It may also be useful to avoid having an optional YAML parser failure terminate the entire setup process under set -e.

Steps to Reproduce

Run setup.sh in ThunderID 1.0.1 on Debian.

Version

1.0.1 Linux x64

Environment Details (with versions)

OS: Debian
Shell: Bash 5.2.x

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions