ZhengPeiRu21 / mod-playerbots

AzerothCore Playerbots Module
MIT License
193 stars 93 forks source link

Unable to update DB acore_playerbots (Docker setup) #152

Open ianmeesters opened 1 year ago

ianmeesters commented 1 year ago

i am unable to get the server to update/populate the acore_playerbots schema in the DB.

I have cloned the correct branch, i cloned the module and placed it in the correct folder. i have added the missing packages to the dockerfile (libboost-thread-dev).

and i have changed the Conf file of the module so that the DB and username/password are set correctly. PlayerbotsDatabaseInfo = "ac-database;3306;root;password;acore_playerbots"

all these changes i was able to find here in the issues but for me it still wont run. This is what the Server.log file gives me. Anyone familiar? I tried looking for other log files but couldn't find anything. (DBErrors is empty)

The SQL query its starting out with also looks fine to me (i'm not great with SQL tho...) Hope anyone here knows what's going on and what i'm possibly doing wrong.

Server.log:

> Using configuration file       /azerothcore/env/dist/etc/worldserver.conf
> Using SSL version:             OpenSSL 1.1.1f  31 Mar 2020 (library: OpenSSL 1.1.1f  31 Mar 2020)
> Using Boost version:           1.71.0

Process priority class set to -15

Loading Modules Configuration...

Using modules configuration:
> playerbots.conf.dist

Initializing Scripts...
> Loading C++ scripts

Opening DatabasePool 'acore_auth'. Asynchronous connections: 1, synchronous connections: 1.
DatabasePool 'acore_auth' opened successfully. 2 total connections running.

Opening DatabasePool 'acore_characters'. Asynchronous connections: 1, synchronous connections: 2.
DatabasePool 'acore_characters' opened successfully. 3 total connections running.

Opening DatabasePool 'acore_world'. Asynchronous connections: 1, synchronous connections: 1.
DatabasePool 'acore_world' opened successfully. 2 total connections running.

Updating Auth database...
>> Auth database is up-to-date! Containing 1 new and 31 archived updates.

Updating Character database...
>> Character database is up-to-date! Containing 3 new and 54 archived updates.

Updating World database...
>> World database is up-to-date! Containing 458 new and 3160 archived updates.

Opening DatabasePool 'acore_playerbots'. Asynchronous connections: 1, synchronous connections: 1.
Could not connect to MySQL database at ac-database: Unknown database 'acore_playerbots'
Database "acore_playerbots" does not exist
Creating database "acore_playerbots"...
Failed to create temporary query file "create_table.sql"!
DatabasePool Playerbots NOT opened. There were errors opening the MySQL connections. Check your log file for specific errors
ianmeesters commented 1 year ago

I think i see what is going on, all these changes are fine up till the SQL create table part. if i manually enter this first line of create_table.sql:GRANT ALL PRIVILEGES ON * . * TO 'acore'@'localhost' WITH GRANT OPTION; I gives me error 1410 (You are not allowed to create a user with GRANT)

my guess is that user acore doesn't exit since its different from the default user 'root'. Later today when i got some time will try to add the acore user. If all works and i get to fully compile, run and play. I will give an update, if you guys see somethings else im doing wrong i'd love to hear it

ianmeesters commented 1 year ago

i have removed the GRANT .... lines from the SQL files since it's logging in with the other user anyway, also made the user acore and gave full permissions just in case. But now it says it cant find the sql files directory.

not sure where these are put in the docker containers? I imagine they are in there cause i tried setting "SourceDirectory" in the worldConf as an absolute path, but that didnt work either.

azerothcore-wotlk-ac-worldserver-1  | DatabasePool 'acore_playerbots' opened successfully. 2 total connections running.
azerothcore-wotlk-ac-worldserver-1  |  
azerothcore-wotlk-ac-worldserver-1  | Database Playerbots is empty, auto populating it...
azerothcore-wotlk-ac-worldserver-1  | >> Directory "/azerothcore/modules/mod-playerbots/sql/playerbots/base/" not exist
azerothcore-wotlk-ac-worldserver-1  | Could not populate the Playerbots database, see log for details.
azerothcore-wotlk-ac-worldserver-1  | Closing down DatabasePool 'acore_playerbots'.
azerothcore-wotlk-ac-worldserver-1  | Asynchronous connections on DatabasePool 'acore_playerbots' terminated. Proceeding with synchronous connections.
azerothcore-wotlk-ac-worldserver-1  | All connections on DatabasePool 'acore_playerbots' closed.
azerothcore-wotlk-ac-worldserver-1  | exit code: 1
azerothcore-wotlk-ac-worldserver-1  | worldserver terminated, restarting...
azerothcore-wotlk-ac-worldserver-1  | worldserver Terminated after 0 seconds, termination count: : 2
azerothcore-wotlk-ac-worldserver-1  | Running without GDB
Philjimg commented 1 year ago

I was encountering this same issue, and i had to modify docker-compose.yml in the main directory to copy the module folder into the worldserver container

under the section APP Services, in the ac-worldserver subsection I added this

       - ${DOCKER_VOL_DATA_MAPS:-./env/docker/data/maps}:/azerothcore/env/dist/data/maps
       - ${DOCKER_VOL_DATA_VMAPS:-./env/docker/data/vmaps}:/azerothcore/env/dist/data/vmaps
       - ${DOCKER_VOL_DATA_MMAPS:-./env/docker/data/mmaps}:/azerothcore/env/dist/data/mmaps
+      - ./modules:/azerothcore/modules
     profiles: [local, app, worldserver]
     depends_on:
       ac-database:

then just run ./acore docker start:app again and it should continue

Hope this helps @ianmeesters