Skip to content

🐛 [BUG]: Error not failing the script execution on missing required variable #514

@fmigneault

Description

@fmigneault

Summary

Enabling https://github.com/bird-house/birdhouse-deploy/tree/master/birdhouse/components/monitoring, and omitting an ALERTMANAGER_SMTP_SERVER variable emits a log error about the missing variable, but doesn't stop the execution as expected.

Details

The following is logged:

ERROR:    Required variable $ALERTMANAGER_SMTP_SERVER is not set. Check env.local file.

But the return 1 from the following does not seem to be triggered (or handled by the calling script?):

check_required_vars() {
for i in ${VARS}
do
v="${i}"
if [ -z "`eval "echo ${v}"`" ]
then
log ERROR "Required variable $v is not set. Check env.local file."
return 1
fi
done
}

Maybe this is related to some kind of subshell error catch/forwarding to the caller, similar to what was observed in #509 (comment)

To Reproduce

Steps to reproduce the behavior:

  1. Enable the monitoring component (or any other?)
  2. Purposely omit some required variable that does not fail the script due to some other cause such as parsing or unresolved reference.
  3. Observe that the birdhouse-compose.sh up -d runs until the end without abort.

Environment

any

Concerned Organizations

all

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions