CI does not run anymore : You must specify POSTGRES_PASSWORD for the superuser
Summary
CI job that used to run on 2020-02-14 10:34am GMT+1 (pipeline 8115), do run anymore (pipeline 8116) four days later, i.e. 2020-02-18 7:04pm GMT+1
Error is You must specify POSTGRES_PASSWORD for the superuser
Steps to reproduce (STR)
- run a CI job
What is the current bug behavior? (CBB)
First error (as seen in the job log):
$ psql -h postgres -U postgres -f backend/database/database.sql
psql: could not translate host name "postgres" to address: Name or service not known
... which leads to:
2020-02-18T18:03:58.410887274Z Error: Database is uninitialized and superuser password is not specified.
2020-02-18T18:03:58.410914209Z You must specify POSTGRES_PASSWORD for the superuser. Use
2020-02-18T18:03:58.410919562Z "-e POSTGRES_PASSWORD=password" to set it in "docker run".
2020-02-18T18:03:58.410923801Z
2020-02-18T18:03:58.410927457Z You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
2020-02-18T18:03:58.410931257Z without a password. This is *not* recommended. See PostgreSQL
2020-02-18T18:03:58.410935036Z documentation about "trust":
2020-02-18T18:03:58.410938872Z https://www.postgresql.org/docs/current/auth-trust.html
What is the expected correct behavior? (ECB)
CI job fails.
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
See https://gitlab.adullact.net/directmairie/directmairie/-/jobs/29217 or https://gitlab.adullact.net/directmairie/directmairie/-/jobs/29216
Running with gitlab-runner 12.4.1 (05161b14)
on shared generic run-untagged u_UX1CxD
Using Docker executor with image ninjasquad/docker-amies ...
00:06
Starting service postgres:11-alpine ...
Pulling docker image postgres:11-alpine ...
Using docker image sha256:b41b79676e63162918a5edd3b4de10390b8f637d0ca0026e35d36e0335b8495d for postgres:11-alpine ...
WARNING: Service postgres:11-alpine is already created. Ignoring.
Waiting for services to be up and running...
*** WARNING: Service runner-u_UX1CxD-project-281-concurrent-0-postgres-0 probably didn't start properly.
Health check error:
ContainerStart: Error response from daemon: Cannot link to a non running container: /runner-u_UX1CxD-project-281-concurrent-0-postgres-0 AS /runner-u_UX1CxD-project-281-concurrent-0-postgres-0-wait-for-service/service (executor_docker.go:1254:0s)
Service container logs:
2020-02-18T18:03:58.410887274Z Error: Database is uninitialized and superuser password is not specified.
2020-02-18T18:03:58.410914209Z You must specify POSTGRES_PASSWORD for the superuser. Use
2020-02-18T18:03:58.410919562Z "-e POSTGRES_PASSWORD=password" to set it in "docker run".
2020-02-18T18:03:58.410923801Z
2020-02-18T18:03:58.410927457Z You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
2020-02-18T18:03:58.410931257Z without a password. This is *not* recommended. See PostgreSQL
2020-02-18T18:03:58.410935036Z documentation about "trust":
2020-02-18T18:03:58.410938872Z https://www.postgresql.org/docs/current/auth-trust.html
*********
Pulling docker image ninjasquad/docker-amies ...
Using docker image sha256:4a09e9ff811babebc1183b5105e35c249c3c02fe090d8182fed17e53ac12815a for ninjasquad/docker-amies ...
Running on runner-u_UX1CxD-project-281-concurrent-0 via ci05.adullact.lan...
00:02
Fetching changes...
Reinitialized existing Git repository in /builds/directmairie/directmairie/.git/
Checking out d289accc as 2.0.0...
Skipping Git submodules setup
Checking cache for 2.0.0...
00:02
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
$ export GRADLE_USER_HOME=`pwd`/.gradle
$ psql -h postgres -U postgres -f backend/database/database.sql
psql: could not translate host name "postgres" to address: Name or service not known
ERROR: Job failed: exit code 1
Possible fixes
- On 2020-02-14, the postgres:11-alpine was upgraded from 11.6 to 11.7, see commit Update to 11.7
- Postgresql 11.7 Release notes
/cc @mfaure