ajanata / PretendYoureXyzzy

A web clone of the card game Cards Against Humanity.
https://pretendyoure.xyz/zy
BSD 2-Clause "Simplified" License
1.23k stars 396 forks source link

Doesn't work out of the box on newer versions of Postgresql #232

Closed keenan-v1 closed 4 years ago

keenan-v1 commented 4 years ago

It would seem that your project is bound to Postgres 8 due to the JDBC drivers. I was having issues getting it to work with a straight install on Ubuntu 18.04 and found out it was due to the default postgres on that distro being Postgres 10.

To get it working I used Postgres 9.6 (docker) (since there doesn't seem to be a compatible 10 JDBC driver on Maven, though I didn't look too hard) and upgraded the JDBC driver to the latest.

The behavior on newer versions of Postgres is that it continuously opens connections and fails to communicate with the database until all connections are exhausted. The symptoms to look for are no card sets on a new game and a mysterious "timeout" error message in the chat. Also "View Cards" will fail with a stacktrace - thankfully it doesn't dump anything that can be used in an attack.

keenan-v1 commented 4 years ago

Turns out just using Posgresql <10 works. I had another issue that was preventing things from working.

Stary2001 commented 4 years ago

The official driver that's already being used - https://jdbc.postgresql.org/ - is available on Maven Central, but the 42.x version is under a different groupId of org.postgresql instead of postgreql for some reason. Changing the existing driver dependency to

<dependency>
  <groupId>org.postgresql</groupId>
  <artifactId>postgresql</artifactId>
  <version>42.2.12</version>
</dependency>

appears to work fine so far for my instance, running Postgres 10.

ajanata commented 4 years ago

@Stary2001 mind opening a PR for that?

Stary2001 commented 4 years ago

Done - #246

ajanata commented 4 years ago

Fixed in #246.