markweirath/big-brother-bot

B3 does not detect that database name is missing in config

Closed this issue · 1 comments

See report on the B3 forums

description

if one setup the database with

<set name="database">mysql://****:****@server1.host.net</set>

instead of

<set name="database">mysql://****:****@server1.host.net/the_database_name</set>

then B3 starts anyway without detecting the issue. Later in the log file we see errors such as :

111106 15:03:15 ERROR   '[SELECT * FROM clients WHERE `guid` = "WORLD" LIMIT 1] None'
111106 15:03:15 ERROR   "auth self.console.storage.getClient(client) - (1046, 'No database selected')\n[('b3\\\\clients.pyo', 696, 'auth', None), ('b3\\\\storage\\\\database.pyo', 347, 'getClient', None), ('b3\\\\storage\\\\database.pyo', 311, 'query', None)]"

proposal

At bot start, parse the database settings and make sure all requirements are met. If not stop loading the bot and display a nice message telling as precisely as possible the issue.

note

This only applies to MySQL and should not be applied to sqlite database settings

now in B3 1.8b2