Ree6-Applications / Ree6

All-in-one, open source and 100% free Discord Bot!
https://ree6.de
GNU General Public License v3.0
145 stars 39 forks source link

[Bug]: Setup of Reebot using Pterodactyl panel doesn't work #608

Closed Jodsderechte closed 4 months ago

Jodsderechte commented 4 months ago

Contact Details

This issue

What happened?

Using the pterodactyl egg https://github.com/pelican-eggs/chatbots/blob/main/discord/ree6/egg-pterodactyl-ree6.json as mentioned in https://wiki.ree6.de/bot/self-hosting/self-host-with-pterodactyl creates the following error

08:06:50.723 [main] ERROR de.presti.ree6.sql.SQLConnector - Migration failed! org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V1__Initial.sql failed 08:06:59 [main] ERROR de.presti.ree6.sql.SQLSession - Initial SessionFactory creation failed. org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [AutoRoles]

I'm sure i've just messed somethign up but i don't rly know what. I've checked https://wiki.ree6.de/bot/configurations for the required configuraiton and have all that setup. I would copy paste you the whole config but i don't rly want my tokens out there in the wild.

Version

v3 (Current)

Relevant log output

08:06:45.941 [main] INFO  de.presti.ree6.main.Main - Creating Sentry Instance. 
08:06:46.006 [main] INFO  de.presti.ree6.main.Main - Starting preparations of the Bot... 
08:06:46.766 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: bg 
08:06:46.986 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: bg! 
08:06:47.106 [main] INFO  d.p.ree6.language.LanguageService - Language file bg is up to date! 
08:06:47.107 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: cs 
08:06:47.289 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: cs! 
08:06:47.333 [main] INFO  d.p.ree6.language.LanguageService - Language file cs is up to date! 
08:06:47.333 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: de 
08:06:47.492 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: de! 
08:06:47.521 [main] INFO  d.p.ree6.language.LanguageService - Language file de is up to date! 
08:06:47.522 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: en-GB 
08:06:47.677 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: en-GB! 
08:06:47.708 [main] INFO  d.p.ree6.language.LanguageService - Language file en-GB is up to date! 
08:06:47.708 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: fr 
08:06:47.863 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: fr! 
08:06:47.908 [main] INFO  d.p.ree6.language.LanguageService - Language file fr is up to date! 
08:06:47.909 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: id 
08:06:48.083 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: id! 
08:06:48.114 [main] INFO  d.p.ree6.language.LanguageService - Language file id is up to date! 
08:06:48.114 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: pl 
08:06:48.281 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: pl! 
08:06:48.314 [main] INFO  d.p.ree6.language.LanguageService - Language file pl is up to date! 
08:06:48.314 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: pt-BR 
08:06:48.483 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: pt-BR! 
08:06:48.508 [main] INFO  d.p.ree6.language.LanguageService - Language file pt-BR is up to date! 
08:06:48.509 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: ru 
08:06:48.740 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: ru! 
08:06:48.764 [main] INFO  d.p.ree6.language.LanguageService - Language file ru is up to date! 
08:06:48.764 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: tr 
08:06:48.932 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: tr! 
08:06:48.953 [main] INFO  d.p.ree6.language.LanguageService - Language file tr is up to date! 
08:06:48.954 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: uk 
08:06:49.102 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: uk! 
08:06:49.121 [main] INFO  d.p.ree6.language.LanguageService - Language file uk is up to date! 
08:06:49.121 [main] INFO  d.p.ree6.language.LanguageService - Downloading Language: zh-CN 
08:06:49.266 [main] INFO  d.p.ree6.language.LanguageService - Version comparing: zh-CN! 
08:06:49.286 [main] INFO  d.p.ree6.language.LanguageService - Language file zh-CN is up to date! 
08:06:49.947 [main] INFO  de.presti.ree6.main.Main - Finished preparations of the Bot! 
08:06:49.947 [main] INFO  de.presti.ree6.main.Main - Starting Ree6! 
08:06:50.053 [main] INFO  org.reflections.Reflections - Reflections took 87 ms to scan 1 urls, producing 9 keys and 9 values 
08:06:50.102 [main] INFO  de.presti.ree6.sql.SQLConnector - Connecting to SQl-Service (SQL). 
08:06:50.106 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... 
08:06:50.239 [main] INFO  com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection org.sqlite.jdbc4.JDBC4Connection@1595246b 
08:06:50.241 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. 
08:06:50.241 [main] INFO  de.presti.ree6.sql.SQLConnector - Service (SQL) has been started. Connection was successful. 
08:06:50.576 [main] INFO  org.flywaydb.core.FlywayExecutor - Database: jdbc:sqlite:storage/Ree6.db (SQLite 3.45) 
08:06:50.640 [main] INFO  de.presti.ree6.sql.SQLConnector - Currently at version: 0 
08:06:50.641 [main] INFO  de.presti.ree6.sql.SQLConnector - Found 8 pending migrations. 
08:06:50.642 [main] INFO  de.presti.ree6.sql.SQLConnector - The pending migrations are: Initial, Add Giveaway, DataTyp Update, FK Update, Correcting Names, Finishing FKs, FixingFKs, Fix Recording 
08:06:50.642 [main] INFO  de.presti.ree6.sql.SQLConnector - Running Flyway Migrations. 
08:06:50.653 [main] INFO  o.f.c.internal.command.DbValidate - Successfully validated 8 migrations (execution time 00:00.005s) 
08:06:50.658 [main] INFO  o.f.core.internal.command.DbMigrate - Current version of schema "main": << Empty Schema >> 
08:06:50.702 [main] INFO  o.f.core.internal.command.DbMigrate - Migrating schema "main" to version "1 - Initial" 
08:06:50.722 [main] ERROR o.f.core.internal.command.DbMigrate - Migration of schema "main" to version "1 - Initial" failed! Changes successfully rolled back. 
08:06:50.723 [main] ERROR de.presti.ree6.sql.SQLConnector - Migration failed! 
org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V1__Initial.sql failed
--------------------------------
SQL State  : null
Error Code : 1
Message    : [SQLITE_ERROR] SQL error or missing database (near "CONSTRAINT": syntax error)
Location   : sql/migrations/V1__Initial.sql (/home/container/file:/home/container/Ree6.jar!/sql/migrations/V1__Initial.sql)
Line       : 405
Statement  : ALTER TABLE Money_Transaction
    ADD CONSTRAINT FK_MONEY_TRANSACTION_ON_RECEIVER FOREIGN KEY (receiver) REFERENCES Money_Holder (Id)

    at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:382)
    at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:272)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:271)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:244)
    at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:139)
    at org.flywaydb.core.internal.jdbc.TableLockingExecutionTemplate$1.call(TableLockingExecutionTemplate.java:36)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
    at org.flywaydb.core.internal.jdbc.TableLockingExecutionTemplate.execute(TableLockingExecutionTemplate.java:31)
    at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:102)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:144)
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:139)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:97)
    at org.flywaydb.core.Flyway.lambda$migrate$0(Flyway.java:202)
    at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:203)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:147)
    at de.presti.ree6.sql.SQLConnector.runMigrations(SQLConnector.java:129)
    at de.presti.ree6.sql.SQLConnector.<init>(SQLConnector.java:64)
    at de.presti.ree6.sql.SQLSession.<init>(SQLSession.java:180)
    at de.presti.ree6.main.Main.main(Main.java:232)
Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Migration V1__Initial.sql failed
--------------------------------
SQL State  : null
Error Code : 1
Message    : [SQLITE_ERROR] SQL error or missing database (near "CONSTRAINT": syntax error)
Location   : sql/migrations/V1__Initial.sql (/home/container/file:/home/container/Ree6.jar!/sql/migrations/V1__Initial.sql)
Line       : 405
Statement  : ALTER TABLE Money_Transaction
    ADD CONSTRAINT FK_MONEY_TRANSACTION_ON_RECEIVER FOREIGN KEY (receiver) REFERENCES Money_Holder (Id)

    at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:272)
    at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:227)
    at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:130)
    at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:68)
    at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:57)
    at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:27)
    at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:56)
    at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:374)
    ... 19 common frames omitted
Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "CONSTRAINT": syntax error)
    at org.sqlite.core.DB.newSQLException(DB.java:1179)
    at org.sqlite.core.DB.newSQLException(DB.java:1190)
    at org.sqlite.core.DB.throwex(DB.java:1150)
    at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
    at org.sqlite.core.NativeDB.prepare(NativeDB.java:132)
    at org.sqlite.core.DB.prepare(DB.java:264)
    at org.sqlite.jdbc3.JDBC3Statement.lambda$execute$0(JDBC3Statement.java:54)
    at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:454)
    at org.sqlite.jdbc3.JDBC3Statement.execute(JDBC3Statement.java:43)
    at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94)
    at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:210)
    at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:89)
    at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:215)
    ... 25 common frames omitted
08:06:50.726 [main] INFO  de.presti.ree6.main.Main - Loading ChatGPTAPI 
08:06:50.732 [main] INFO  d.p.ree6.commands.CommandManager - Initializing Commands! 
08:06:50.856 [main] INFO  org.reflections.Reflections - Reflections took 123 ms to scan 1 urls, producing 7 keys and 165 values 
08:06:50.902 [main] INFO  de.presti.ree6.main.Main - Creating JDA Instance. 
08:06:50.903 [main] INFO  de.presti.ree6.bot.BotWorker - Loading git information... 
08:06:50.904 [main] INFO  de.presti.ree6.bot.BotWorker - Creating Instance build 3.1.13 
08:06:51.464 [main] INFO  n.d.jda.api.sharding.ShardManager - Login Successful! 
08:06:51.709 [main] INFO  de.presti.ree6.main.Main - Loading GiveawayManager 
08:06:51.776 [main] INFO  org.hibernate.Version - HHH000412: Hibernate ORM core version 3.1.13 
08:06:51.915 [JDA [0 / 1] MainWS-ReadThread] INFO  n.d.j.i.requests.WebSocketClient - Connected to WebSocket 
08:06:52.102 [JDA [0 / 1] MainWS-ReadThread] INFO  net.dv8tion.jda.api.JDA - Finished Loading! 
08:06:52.106 [JDA [0 / 1] MainWS-ReadThread] INFO  de.presti.ree6.events.OtherEvents - Boot up finished! 
08:06:56.363 [main] INFO  org.reflections.Reflections - Reflections took 4568 ms to scan 1 urls, producing 10416 keys and 56089 values 
08:06:57.105 [main] INFO  o.h.c.i.RegionFactoryInitiator - HHH000026: Second-level cache disabled 
08:06:57.193 [main] INFO  o.h.e.j.c.i.ConnectionProviderInitiator - HHH000130: Instantiating explicit connection provider: org.hibernate.hikaricp.internal.HikariCPConnectionProvider 
08:06:57.197 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Starting... 
08:06:57.199 [main] INFO  com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Added connection org.sqlite.jdbc4.JDBC4Connection@5b078b2 
08:06:57.200 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Start completed. 
08:06:59.001 [main] INFO  o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration) 
08:06:59.027 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Shutdown initiated... 
08:06:59.029 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Shutdown completed. 
08:06:59.029 [main] ERROR de.presti.ree6.sql.SQLSession - Initial SessionFactory creation failed. 
org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [AutoRoles]
    at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:134)
    at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:46)
    at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:97)
    at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:75)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:295)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.lambda$process$5(SchemaManagementToolCoordinator.java:145)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:142)
    at org.hibernate.boot.internal.SessionFactoryObserverForSchemaExport.sessionFactoryCreated(SessionFactoryObserverForSchemaExport.java:37)
    at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:315)
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:450)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:941)
    at de.presti.ree6.sql.SQLSession.buildSessionFactory(SQLSession.java:235)
    at de.presti.ree6.sql.SQLSession.getSessionFactory(SQLSession.java:333)
    at de.presti.ree6.sql.SQLWorker.getEntityList(SQLWorker.java:2356)
    at de.presti.ree6.sql.SQLWorker.getEntityList(SQLWorker.java:2325)
    at de.presti.ree6.module.giveaway.GiveawayManager.load(GiveawayManager.java:39)
    at de.presti.ree6.module.giveaway.GiveawayManager.<init>(GiveawayManager.java:25)
    at de.presti.ree6.main.Main.main(Main.java:334)

Code of Conduct

DxsSucuk commented 4 months ago

Please read the guide for failed migrations. https://wiki.ree6.de/troubleshooting/migration-failed

Jodsderechte commented 4 months ago

Not entire sure how i'll run scripts in a containerized environment but i'll take a look thank you!

DxsSucuk commented 4 months ago

You have to make a database via pterodactyl. Once you do so you can run the docker exec command to run code on a container.