Postgresql 14 broken on Focal

This was perfectly working until two days ago. 3/11
Nothing in Travis configuration was changed.
Here is the relevant snippet for .travis.yml :

os: linux
dist: focal
env:
  global:
    - PGPORT=5433
...
...
      addons:
        postgresql: '14'
        apt:
          packages:
            - postgresql-14
            - postgresql-14-postgis-3
...
...
      before_install:
        - sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
        - sudo service postgresql restart
        - sleep 1
        - postgres --version
...
...
      before_script:
        - psql --username=travis --port=5433 -c "CREATE EXTENSION postgis;"

I got this error:

$ psql --username=travis --port=5433 -c "CREATE EXTENSION postgis;"
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5433" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?
The command "psql --username=travis --port=5433 -c "CREATE EXTENSION postgis;"" failed and exited with 2 during .

In the Job Log I can also see this:

$ travis_setup_postgresql 14
Starting PostgreSQL v14
Assertion failed on job for postgresql@14-main.service.
sudo systemctl start postgresql@14-main

Thank you in advance.

I’m facing the same issue, but on Jammy using the Postgresql 10:

My config file:

language: python
dist: jammy
...

addons:
  apt:
    packages:
      - postgresql-10
      - postgresql-client-10
      - postgresql-10-postgis-3
  postgresql: '10'

...

services:
  - docker
  - mysql
  - postgresql

before_install:
  - sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
  - sudo service postgresql restart
  - sleep 1
...

The error:

$travis_setup_postgresql 10
Starting PostgreSQL v10
Assertion failed on job for postgresql@10-main.service.
sudo systemctl start postgresql@10-main

And it started about 2 days ago when Travis was updated…

For Postgres 14,

Please use jammy as your distro in your .travis.yml.

If you want to use even a newer version of Postgres, say Postgres 16, use dist: noble. See my example build here: