Recently my builds started failing although the Travis config did not change. I’m trying to run Postgres v10 in Bionic. The error I get is:
Starting PostgreSQL v10
Job for postgresql@10-main.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status postgresql@10-main.service" and "journalctl -xe" for details.
sudo systemctl start postgresql@10-main
I’ve created a minimal repro to demonstrate. Here is the failed job. Here are the relevant parts of the config:
Of course it fails when it tries to run psql because it cannot connect:
psql: 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"?
Can’t post links (I’m on .com not .org), but my builds continue to fail:
travis_setup_postgresql 10 eStarting PostgreSQL v10e Job for postgresql@10-main.service failed because the service did not take the steps required by its unit configuration. See "systemctl status postgresql@10-main.service" and "journalctl -xe" for details.
… psql -c "CREATE DATABASE travisci;" -U postgres psql: 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"?
This was working absolutely fine as recently as yesterday. However, yours looks like this:
addons:
postgresql: "10"
Removing the apt section from mine resolved the issue, but this is definitely a change on Travis’ end as my config has not changed since yesterday and previously passing builds now fail.
@BanzaiMan Thanks for providing a suggestion. For what is worth, I shared links and detailed examples via support on the ticket I opened on Thursday. I yet have to receive a reply after 4 days
We ultimately addressed it by removing postgresql-10 as suggested here. I’d love to better understand if my support request got lost in the wire.
I’m still seeing this issue today in Bionic. Unfortunately since I’m using postgresql-contrib-10, none of the solutions posted above worked for me. However, this did: