Postgresql broken on Focal

It seems to me that something has changed recently (this week) with Postgresql on Focal.

My configuration starts with

dist: focal
language: python
python:
  - "3.8"

addons:
  apt:
    packages:
      - yarnpkg
  postgresql: "12"
services:
  - postgresql
  - redis-server
…
before_script:
  - psql -c 'CREATE DATABASE fereol_test;' -U postgres

It used to work perfectly well, and suddenly, yesterday, my builds started failing on CREATE DATABASE step with the message:

$ psql -c 'CREATE DATABASE fereol_test;' -U postgres
psql: error: could not connect to server: 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"?
The command "psql -c 'CREATE DATABASE fereol_test;' -U postgres" failed and exited with 2 during .

(the build: https://travis-ci.com/github/iiuni/projektzapisy/jobs/420866754)
Earlier in the run—while configuring Postgres—it says:

Assertion failed on job for postgresql@12-main.service.

I tried playing with the config: changing Postgres version, installing the packages manually. I was not able to set it up correctly.

Is it a bug, or is my configuration wrong?

1 Like

Changing Postgres version to “13” seems to have fixed the issue.

Are earlier versions of Postgres not supported any more?

1 Like

This will help you a bit more:

As a matter of fact it didn’t help. This documentation does not explain, why my configuration is not working. Neither does it say, why the same exact configuration does work with Graviton2/LXD.

We experienced the same problem.
Using Postgresql does not work with:
Build image provisioning date and time
Tue 03 Nov 2020 10:34:47 AM UTC

However, it worked without problems on
Build image provisioning date and time
Tue 25 Aug 2020 10:07:36 AM UTC

See https://travis-ci.org/github/bareos/bareos/jobs/742402304 (well, no the best build log to debug postgres problems).

Hey folks,

I will send this into our internal support team as soon as possible.

-Montana Mendy
(Travis CI Staff)

1 Like

Hello, I encountered the same issue. Is there any plan to fix this issue? Or, we have to use the upper version of PostgreSQL?

Hello,

I have crafted a .travis.yml [1] file that may be helpful for your case as well.

Thanks.

[1] Postgre12 on Focal · GitHub

1 Like