Postgres probably didn't start properly Status code: 139

I’ve been tying to configure my project to use GitLab CI, but I keep getting an error with postgres’ initialization:

gitlab-ci-multi-runner 0.5.5-1-g69bc934 (69bc934)
Using Docker executor with image python:3.4.3 ...
Starting service postgres:latest ...
Waiting for services to be up and running...
Service runner-32f405e8-project-7428-concurrent-0-postgres probably didn't start properly Status code: 139
Running on runner-32f405e8-project-7428-concurrent-0 via ci-runner01...

I tried both the shared runners, and my own runner at a dedicated machine on DO. The shared runners on did offer a bit more verbosity, but nothing I could make any use of:

*** WARNING: Service runner-055dc32a-project-7428-concurrent-0-postgres probably didn't start properly.

Status code: 139
2015-09-19T18:35:01.565375116Z The files belonging to this database system will be owned by user "postgres".
2015-09-19T18:35:01.565480483Z This user must also own the server process.
2015-09-19T18:35:01.566159990Z The database cluster will be initialized with locale "en_US.utf8".
2015-09-19T18:35:01.566190440Z The default database encoding has accordingly been set to "UTF8".
2015-09-19T18:35:01.566249633Z The default text search configuration will be set to "english".
2015-09-19T18:35:01.566313073Z Data page checksums are disabled.
2015-09-19T18:35:01.566603640Z fixing permissions on existing directory /var/lib/postgresql/data ... ok
2015-09-19T18:35:01.577085707Z creating subdirectories ... ok
2015-09-19T18:35:01.636073946Z selecting default max_connections ... 100
2015-09-19T18:35:01.679777495Z selecting default shared_buffers ... 128MB
2015-09-19T18:35:01.680135465Z selecting dynamic shared memory implementation ... posix
2015-09-19T18:35:02.526338879Z creating configuration files ... ok
2015-09-19T18:35:03.116547791Z creating template1 database in /var/lib/postgresql/data/base/1 ... ok
2015-09-19T18:35:03.139849685Z initializing pg_authid ... ok
2015-09-19T18:35:03.201591861Z initializing dependencies ... ok
2015-09-19T18:35:03.334986283Z creating system views ... ok
2015-09-19T18:35:03.408547235Z loading system objects' descriptions ... ok
2015-09-19T18:35:03.496577093Z creating collations ... ok
2015-09-19T18:35:03.688874713Z creating conversions ... ok
2015-09-19T18:35:03.689399801Z creating dictionaries ... ok
2015-09-19T18:35:03.689419898Z setting privileges on built-in objects ... ok
2015-09-19T18:35:03.930857940Z creating information schema ... ok
2015-09-19T18:35:03.945623801Z loading PL/pgSQL server-side language ... ok
2015-09-19T18:35:04.315612019Z vacuuming database template1 ... ok
2015-09-19T18:35:04.381237885Z copying template1 to template0 ... ok
2015-09-19T18:35:04.427038384Z copying template1 to postgres ... ok
2015-09-19T18:35:04.910697065Z syncing data to disk ... ok
2015-09-19T18:35:04.930872403Z Success. You can now start the database server using:
2015-09-19T18:35:04.930904593Z     postgres -D /var/lib/postgresql/data
2015-09-19T18:35:04.930916880Z or
2015-09-19T18:35:04.930929123Z     pg_ctl -D /var/lib/postgresql/data -l logfile start
2015-09-19T18:35:04.939414754Z WARNING: enabling "trust" authentication for local connections
2015-09-19T18:35:04.939493623Z You can change this by editing pg_hba.conf or using the option -A, or
2015-09-19T18:35:04.939516878Z --auth-local and --auth-host, the next time you run initdb.
2015-09-19T18:35:04.939741129Z ****************************************************
2015-09-19T18:35:04.939773192Z WARNING: No password has been set for the database.
2015-09-19T18:35:04.939785398Z          This will allow anyone with access to the
2015-09-19T18:35:04.939822004Z          Postgres port to access your database. In
2015-09-19T18:35:04.939835771Z          Docker's default configuration, this is
2015-09-19T18:35:04.939865632Z          effectively any other container on the same
2015-09-19T18:35:04.939881072Z          system.
2015-09-19T18:35:04.939904134Z          Use "-e POSTGRES_PASSWORD=password" to set
2015-09-19T18:35:04.939929220Z          it in "docker run".
2015-09-19T18:35:04.939941306Z ****************************************************
2015-09-19T18:35:05.022773192Z waiting for server to start....LOG:  database system was shut down at 2015-09-19 18:35:04 UTC
2015-09-19T18:35:05.025442678Z LOG:  MultiXact member wraparound protections are now enabled
2015-09-19T18:35:05.026040488Z LOG:  database system is ready to accept connections
2015-09-19T18:35:05.044851499Z LOG:  autovacuum launcher started
2015-09-19T18:35:06.083666140Z  done
2015-09-19T18:35:06.083716570Z server started
2015-09-19T18:35:06.084083185Z ALTER ROLE
2015-09-19T18:35:06.084119849Z / ignoring /docker-entrypoint-initdb.d/*
2015-09-19T18:35:06.084132449Z LOG:  received fast shutdown request
2015-09-19T18:35:06.084138231Z LOG:  aborting any active transactions
2015-09-19T18:35:06.084143854Z LOG:  autovacuum launcher shutting down
2015-09-19T18:35:06.084149617Z LOG:  shutting down
2015-09-19T18:35:06.096266352Z waiting for server to shut down....LOG:  database system is shut down

The failure to initialize is consistent with later results:

django.db.utils.OperationalError: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I also tried to connecto to localhost:5432. This did not work either, but I didn’t expect it to.

Here’s my /etc/gitlab-runner/config.toml:

concurrent = 4

  name = "ci-runner01"
  url = ""
  token = "redacted :D"
  limit = 1
  executor = "docker"
  disable_verbose = false
    image = "python:3.4.3"
    privileged = false
    volumes = ["/cache"]
    services = ["postgres:latest"]
    allowed_services = ["postgres:*"]
    allowed_images = ["python:*"]

My .gitlab-ci.yml is:

$ cat .gitlab-ci.yml
  - pip install tox
    - tox
    - postgres
  MYAPP_STUFF = "redacted"

After much searching, I’ve failed to find any way to further debug this, nor any similar errors online. I also don’t quite understand why the shared runners offer much more verbosity when postgres fails to initialize, nor how to imitate this.

It seems I might be in a very singular scenario.
Any hints?

After a brief discussion on IRC, I’ve opened an issue for this, so anyone interested, please follow up there.