For a couple weeks now, one of my Travis-CI jobs have been failing due to the PostgreSQL instance starting on port 5433 instead of 5432. (subsequent code assumes that postgresql is running on port 5432 ie psql command). Anyway, I can not resolve why PostgreSQL is listening on 5433.
A recent build failure where I attempted to debug what was happening.
$ sudo service postgresql status 10
9.2/main (port 5432): down
9.3/main (port 5432): down
9.4/main (port 5432): down
9.5/main (port 5432): down
9.6/main (port 5432): down
10/main (port 5433): online
Thanks. So I guess the issue is with the addons functionality, hmm. I guess I should spin up a trusty instance and try to debug the issue with the apt packages? Unsure what to do otherwise.
Oh thank you so much! Just for another data point, I stripped my .travis.yml down to just this and got the same port issue, whatâs puzzling is that I have another project that uses about the same travis config and it is not failing in this matter.
sudo: required
dist: trusty
addons:
postgresql: "10"
apt:
packages:
- postgresql-10-postgis-2.4
before_install:
- sudo service postgresql status 10
- sudo ls -ltra /tmp
- sudo netstat -nlp
Sorry to hear about the continued troubles. If you wish, we can enable the debug feature for your repo (if itâs public) so you can have an interactive session.
Thanks for the continued help and offer. Amazingly, my builds are back to green again. I think my blissful ignorance, many moving parts, and changes to the postgresql config conspired against me.
Note that the original issue of postgresql running on TCP:5433 somehow went away without me directly addressing it.
I think the biggest issue was that I was providing a custom postgresql whose psql was in front of my $PATH and assumed that postgresql had a socket file in /tmp. That file is now limited to /var/run/postgresql, which I think was a recent change in xenial packaging?
Also, as the docs denote for xenial, you need to start postgresql via
serivces:
- postgresql
I was then able to remove all the config file munging and use a basic config for either postgresql 10 or 9.6 and have it work.