EvEmu-Project / evemu_Crucible

Emulator for EvE Online's Crucible expansion
https://evemu.dev
174 stars 68 forks source link

Missing database tables related to dungeon editor #246

Closed phillipwgardner closed 1 year ago

phillipwgardner commented 1 year ago

Description: As of db81c4097bfc319fabbca70a74bbf070cf3917b0 I receive the following errors in the evemu_server container log:

20:13:52 [DB Error] DoQuery_locked(/src/src/eve-core/database/dbcore.cpp:345): DBCore Query - #1146 in 'SELECT dunRoomID, dunGroupID, xpos, ypos, zpos FROM dunRoomData': Table 'evemu.dunRoomData' doesn't exist
20:13:52 [DB Error] Error in GetDunRoomData query: Table 'evemu.dunRoomData' doesn't exist
20:13:52 [DB Error] DoQuery_locked(/src/src/eve-core/database/dbcore.cpp:320): DBCore - Status != Connected
20:13:52 [DB Error] DoQuery_locked(/src/src/eve-core/database/dbcore.cpp:345): DBCore Query - #1146 in 'SELECT d.dunGroupID, d.itemTypeID, d.itemGroupID, t.typeName, t.groupID, g.categoryID, t.radius, d.xpos, d.ypos, d.zpos FROM dunGroupData AS d  LEFT JOIN invTypes AS t ON d.itemTypeID = t.typeID  LEFT JOIN invGroups AS g ON g.groupID = t.groupID': Table 'evemu.dunGroupData' doesn't exist
20:13:52 [DB Error] Error in GetDunGroupData query: Table 'evemu.dunGroupData' doesn't exist
20:13:52 [DB Error] DoQuery_locked(/src/src/eve-core/database/dbcore.cpp:320): DBCore - Status != Connected

This happens when Database Manager establishes the MySQL connection.

Reproduction:

  1. git clone from staging
  2. docker-compose
  3. docker logs -f evemu_server
  4. See error

Expected behaviour: Normal startup of the emulator.

System Details:

jdhirst commented 1 year ago

@kimrosebush can you please run the following check:

docker exec -it evemu_server /bin/bash
cd /src/sql
./evedbtool status

It seems like your database is not updated to the latest schema, so that command should let us check the latest revision applied.

phillipwgardner commented 1 year ago

@kimrosebush can you please run the following check:

docker exec -it evemu_server /bin/bash
cd /src/sql
./evedbtool status

It seems like your database is not updated to the latest schema, so that command should let us check the latest revision applied.

You're right @jdhirst, there's some missing migration files.

evemu@evemu:~$ docker exec -it evemu_server /bin/bash
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/evemu_server/json": dial unix /var/run/docker.sock: connect: permission denied
evemu@evemu:~$ sudo !!
sudo docker exec -it evemu_server /bin/bash
[sudo] password for evemu:
[root@aa62e5b996c4 /]# cd /src/sql
[root@aa62e5b996c4 sql]# ./evedbtool status
INFO[0000] EVEDBTool 0.0.5
Could not find migration file: 20211011182454-ihub.sql
Could not find migration file: 20211014195641-beacon_jammer.sql
Could not find migration file: 20211019155214-contracts.sql
Could not find migration file: 20211021144025-outpost.sql
Could not find migration file: 20211113194519-wormhole_staticdata.sql
Could not find migration file: 20211118111620-dungeonEditor.sql
Could not find migration file: 20220328120907-loyaltypoints.sql
+------------------------------------------+-------------------------------+
|                MIGRATION                 |            APPLIED            |
+------------------------------------------+-------------------------------+
| 20210409112552-alliance.sql              | 2022-03-18 06:04:57 +0000 UTC |
| 20210409120025-sov.sql                   | 2022-03-18 06:04:57 +0000 UTC |
| 20210414084947-corpfix.sql               | 2022-03-18 06:04:57 +0000 UTC |
| 20210414092905-liveupdates.sql           | 2022-03-18 06:04:57 +0000 UTC |
| 20210514214534-piPins.sql                | 2022-03-18 06:04:57 +0000 UTC |
| 20210911100150-ramjobs_calendar.sql      | 2022-03-18 06:04:57 +0000 UTC |
| 20210911121508-crpAutoPay.sql            | 2022-03-18 06:04:57 +0000 UTC |
| 20210911143004-market_decimal_prices.sql | 2022-03-18 06:04:58 +0000 UTC |
| 20211009060649-crpAutoPayFix.sql         | 2022-03-18 06:04:58 +0000 UTC |
+------------------------------------------+-------------------------------+
[root@aa62e5b996c4 sql]

What would be the recommended corrective action? Thanks! @kimrosebush

phillipwgardner commented 1 year ago

@kimrosebush can you please run the following check:

docker exec -it evemu_server /bin/bash
cd /src/sql
./evedbtool status

It seems like your database is not updated to the latest schema, so that command should let us check the latest revision applied.

You're right @jdhirst, there's some missing migration files.

evemu@evemu:~$ docker exec -it evemu_server /bin/bash
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/evemu_server/json": dial unix /var/run/docker.sock: connect: permission denied
evemu@evemu:~$ sudo !!
sudo docker exec -it evemu_server /bin/bash
[sudo] password for evemu:
[root@aa62e5b996c4 /]# cd /src/sql
[root@aa62e5b996c4 sql]# ./evedbtool status
INFO[0000] EVEDBTool 0.0.5
Could not find migration file: 20211011182454-ihub.sql
Could not find migration file: 20211014195641-beacon_jammer.sql
Could not find migration file: 20211019155214-contracts.sql
Could not find migration file: 20211021144025-outpost.sql
Could not find migration file: 20211113194519-wormhole_staticdata.sql
Could not find migration file: 20211118111620-dungeonEditor.sql
Could not find migration file: 20220328120907-loyaltypoints.sql
+------------------------------------------+-------------------------------+
|                MIGRATION                 |            APPLIED            |
+------------------------------------------+-------------------------------+
| 20210409112552-alliance.sql              | 2022-03-18 06:04:57 +0000 UTC |
| 20210409120025-sov.sql                   | 2022-03-18 06:04:57 +0000 UTC |
| 20210414084947-corpfix.sql               | 2022-03-18 06:04:57 +0000 UTC |
| 20210414092905-liveupdates.sql           | 2022-03-18 06:04:57 +0000 UTC |
| 20210514214534-piPins.sql                | 2022-03-18 06:04:57 +0000 UTC |
| 20210911100150-ramjobs_calendar.sql      | 2022-03-18 06:04:57 +0000 UTC |
| 20210911121508-crpAutoPay.sql            | 2022-03-18 06:04:57 +0000 UTC |
| 20210911143004-market_decimal_prices.sql | 2022-03-18 06:04:58 +0000 UTC |
| 20211009060649-crpAutoPayFix.sql         | 2022-03-18 06:04:58 +0000 UTC |
+------------------------------------------+-------------------------------+
[root@aa62e5b996c4 sql]

What would be the recommended corrective action? Thanks! @kimrosebush

I tried a docker image purge -a, delete my evemu_Crucible folder and repull and then rebuild. The same errors exist as indicated above, in addition on first startup of the container the following is noticed:

INFO[0000] EVEDBTool 0.0.6-dirty INFO[0000] Number of tables in DB: 299 INFO[0000] Base database already installed. Won't overwrite. Migration failed: Unable to create migration plan because of 20211011182454-ihub.sql: unknown migration in database Starting eve-server...

I will try to search for the files listed above so it can operate correctly?

phillipwgardner commented 1 year ago

I see the problem now, it appears the files only exist in staging branch and are not in master. I will switch branch and re-build.

phillipwgardner commented 1 year ago

Build is successful on staging, everything works now. :)