rainbowdashlabs / reputation-bot

Reputation bot which collects reputation based on chat messages in discord
GNU Affero General Public License v3.0
29 stars 15 forks source link

Database update failed org.postgresql.util.PSQLException: ERROR: syntax error at or near "TRIGGER" #561

Closed MisterUnknownWasKnown closed 10 months ago

MisterUnknownWasKnown commented 10 months ago

Hey, after running start.sh I get the error "Database update failed org.postgresql.util.PSQLException: ERROR: syntax error at or near "TRIGGER""

PostgreSQL Version: 13.11.0

Below the db part of my config and the full log: CONFIG:

 "database" : {
    "host" : "localhost",
    "port" : "5432",
    "database" : "repbot",
    "schema" : "repbot",
    "user" : "repbot",
    "password" : "<password>",
    "poolSize" : 5
  },

LOG:

[22:52:52][INF][           Data] Configuring QueryBuilder
[22:52:53][INF][           Data] Creating connection pool.
[22:52:53][INF][taSourceCreator] Creating Hikari config using jdbc url: jdbc:postgresql://localhost:5432/repbot?user=repbot&password=******
[22:52:53][INF][ikariDataSource] HikariPool-1 - Starting...
[22:52:54][INF][     HikariPool] HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@596df867
[22:52:54][INF][ikariDataSource] HikariPool-1 - Start completed.
[22:52:54][INF][stgreSqlUpdater] Schema repbot did not exist. Created.
[22:52:54][INF][     SqlUpdater] Version table repbot.repbot_version is empty. Attempting database setup.
[22:52:54][INF][     SqlUpdater] Setup database with version 1
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/setup.sql
[22:52:54][INF][     SqlUpdater] Initial setup complete. Ready to patch.
[22:52:54][INF][     SqlUpdater] Set database to version 1 patch 0!
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_1.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_2.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_3.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_4.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_5.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_6.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_7.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_8.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_9.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_10.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_11.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_12.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_13.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_14.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_15.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_16.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_17.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_18.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_19.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_20.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_21.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_22.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_23.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_24.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_25.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_26.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_27.sql
[22:52:54][INF][     SqlUpdater] Loading resource database/postgresql/1/patch_28.sql
[22:52:54][INF][     SqlUpdater] Database is 28 versions behind.
[22:52:54][INF][     SqlUpdater] Performing update.
[22:52:54][INF][     SqlUpdater] Applying patch 1.1
[22:52:54][INF][     SqlUpdater] Patch applied.
[22:52:54][INF][     SqlUpdater] Set database to version 1 patch 1!
[22:52:54][INF][     SqlUpdater] Deployed patch 1.1 to database.
[22:52:54][INF][     SqlUpdater] Applying patch 1.2
[22:52:54][INF][     SqlUpdater] Patch applied.
[22:52:54][INF][     SqlUpdater] Set database to version 1 patch 2!
[22:52:54][INF][     SqlUpdater] Deployed patch 1.2 to database.
[22:52:54][INF][     SqlUpdater] Applying patch 1.3
[22:52:54][INF][     SqlUpdater] Patch applied.
[22:52:54][INF][     SqlUpdater] Set database to version 1 patch 3!
[22:52:54][INF][     SqlUpdater] Deployed patch 1.3 to database.
[22:52:54][INF][     SqlUpdater] Applying patch 1.4
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 4!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.4 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.5
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 5!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.5 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.6
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 6!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.6 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.7
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 7!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.7 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.8
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 8!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.8 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.9
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 9!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.9 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.10
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 10!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.10 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.11
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 11!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.11 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.12
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 12!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.12 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.13
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 13!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.13 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.14
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 14!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.14 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.15
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 15!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.15 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.16
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 16!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.16 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.17
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 17!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.17 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.18
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 18!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.18 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.19
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 19!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.19 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.20
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 20!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.20 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.21
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 21!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.21 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.22
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 22!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.22 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.23
[22:52:55][INF][     SqlUpdater] Patch applied.
[22:52:55][INF][     SqlUpdater] Set database to version 1 patch 23!
[22:52:55][INF][     SqlUpdater] Deployed patch 1.23 to database.
[22:52:55][INF][     SqlUpdater] Applying patch 1.24
[22:52:55][WAR][     SqlUpdater] Database update failed org.postgresql.util.PSQLException: ERROR: syntax error at or near "TRIGGER"
  Position: 21
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2713)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2401)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:368)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:498)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:415)
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190)
        at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:177)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
        at de.chojo.sadu.updater.SqlUpdater.performUpdate(SqlUpdater.java:207)
        at de.chojo.sadu.updater.SqlUpdater.init(SqlUpdater.java:186)
        at de.chojo.sadu.update.PostgreSqlUpdaterBuilder.execute(PostgreSqlUpdaterBuilder.java:43)
        at de.chojo.repbot.core.Data.updateDatabase(Data.java:78)
        at de.chojo.repbot.core.Data.init(Data.java:55)
        at de.chojo.repbot.core.Data.create(Data.java:48)
        at de.chojo.repbot.ReputationBot.start(ReputationBot.java:39)
        at de.chojo.repbot.ReputationBot.main(ReputationBot.java:25)
MisterUnknownWasKnown commented 10 months ago

Updating psql to v16 seems to have fixed the issue