CloudWatch logs for a newly-deployed API container merely a single log entry, and then the container service exited with exit code 1:
/code/bin/production-docker-entrypoint.sh: line 8: POSTGRES_HOST: unbound variable
Problem
The POSTGRES_HOST environment variable wasn't getting set by the time it was being used.
Solution
We moved up the source get-ssm-parameters.sh script ahead of first-use of POSTGRES_HOST - that script includes an export of that env var, and source ensures it persists.
CloudWatch logs for a newly-deployed API container merely a single log entry, and then the container service exited with exit code 1:
/code/bin/production-docker-entrypoint.sh: line 8: POSTGRES_HOST: unbound variable
Problem
The POSTGRES_HOST environment variable wasn't getting set by the time it was being used.
Solution
We moved up the
source get-ssm-parameters.sh
script ahead of first-use of POSTGRES_HOST - that script includes anexport
of that env var, andsource
ensures it persists.API repo for the current commit
This is the code that led to this error in ECS: https://github.com/hackoregon/housing-2018/commit/28646acde47997a2ac4611d5b5bdd79e0d48d6ff