Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
In our support boards we aim to provide support for the B3 core in its current state. Older releases of B3 are NOT supported. Check our front page for the latest version. You may post feature requests in our General Discussion board. Modifications and Hacks of the core B3 code are NOT supported.
Before you ask for support: [ Read the Support Instructions ] - More info: [ Full Support Disclaimer ]

Author Topic: Not connecting to DB  (Read 531 times)

Offline Whiist

  • Newbie
  • *
  • Posts: 5
Not connecting to DB
« on: June 09, 2017, 03:35:15 PM »
Hi there, So purchased Cod4 server + A B3 Bot server from a hosting company, they've put them both on the same box, Got my Cod4 server up and running but having troubles setting up my B3 bot when trying to get it connect to the Database.. thought I'd ask here incase its an error on my part and not an issue somewhere within the hosting.

Code: [Select]
<configuration>
  <settings name="b3">
    <!-- parser defines the game: cod/cod2/cod4/cod5/iourt41/etpro/wop/smg -->
    <set name="parser">cod4</set>
    <set name="database">mysql://db_18244:[email protected]/db_18244</set>
    <set name="bot_name">b3</set>
    <set name="bot_prefix">^0(^2b3^0)^7:</set>
    <set name="time_format">%I:%M%p %Z %m/%d/%y</set>
    <set name="time_zone">CST</set>
    <!-- 9 = verbose, 10 = debug, 21 = bot, 22 = console -->
    <set name="log_level">9</set>
    <set name="logfile">b3.log</set>
  </settings>
  <settings name="server">
    <set name="rcon_password">************</set>
    <set name="port">28960</set>
    <set name="game_log"></set>
    <set name="public_ip">188.165.210.64</set>
    <set name="rcon_ip">188.165.210.64</set>
    <set name="punkbuster">off</set>
  </settings>
  <settings name="messages">
    <set name="kicked_by">%s^7 was kicked by %s^7 %s</set>
    <set name="kicked">%s^7 was kicked %s</set>
    <set name="banned_by">%s^7 was banned by %s^7 %s</set>
    <set name="banned">%s^7 was banned %s</set>
    <set name="temp_banned_by">%s^7 was temp banned by %s^7 for %s^7 %s</set>
    <set name="temp_banned">%s^7 was temp banned for %s^7 %s</set>
    <set name="unbanned_by">%s^7 was un-banned by %s^7 %s</set>
    <set name="unbanned">%s^7 was un-banned %s</set>
  </settings>
  <settings name="plugins">
    <set name="external_dir">@b3/extplugins</set>
  </settings>
  <plugins>
    <plugin name="censor" priority="1" config="@b3/conf/plugin_censor.xml"/>
    <plugin name="spamcontrol" priority="2" config="@b3/conf/plugin_spamcontrol.xml"/>
    <plugin name="admin" priority="3" config="@b3/conf/plugin_admin.xml"/>
    <plugin name="tk" priority="4" config="@b3/conf/plugin_tk.xml"/>
    <plugin name="stats" priority="5" config="@b3/conf/plugin_stats.xml"/>
    <plugin name="pingwatch" priority="6" config="@b3/conf/plugin_pingwatch.xml"/>
    <plugin name="adv" priority="7" config="@b3/conf/plugin_adv.xml"/>
    <plugin name="status" priority="8" config="@b3/conf/plugin_status.xml"/>
    <plugin name="welcome" priority="9" config="@b3/conf/plugin_welcome.xml"/>
    <plugin name="publist" priority="10" config="@b3/conf/plugin_publist.xml"/>
    <plugin name="punkbuster" priority="11" config="@b3/conf/plugin_punkbuster.xml"/>
    <plugin name="xlrstats" priority="12" config="@b3/extplugins/conf/xlrstats.xml"></plugin>

  </plugins>
</configuration>
Everything above in the b3.xml was automatically set by default even the database name.

Here's the log it gives;
Code: [Select]
170609 14:23:11	BOT    	'www.bigbrotherbot.net (b3) v1.9.2 [nt] [PoisonIvy] [Win32 standalone]'
170609 14:23:11 BOT     'Python: 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]'
170609 14:23:11 BOT     'Default encoding: ascii'
170609 14:23:11 BOT     'Starting Cod4Parser v1.3.9 for server 188.165.210.64:28960'
170609 14:23:11 BOT     '--------------------------------------------'
170609 14:23:11 BOT     'Attempting to connect to database mysql://db_18244:[email protected]/db_18244...'
170609 14:23:11 ERROR 'Database connection failed, working in remote mode: (1045, "Access denied for user \'db_18244\'@\'localhost\' (using password: YES)") - [(\'b3\\\\storage\\\\database.pyo\', 243, \'connect\', None), (\'b3\\\\storage\\\\database.pyo\', 188, \'getConnection\', None), (\'MySQLdb\\\\__init__.pyo\', 81, \'Connect\', None), (\'MySQLdb\\\\connections.pyo\', 187, \'__init__\', None)]'
170609 14:23:11 BOT     'Game log '
170609 14:23:11 BOT     'Starting bot reading file .'
170609 14:23:11 ERROR 'Error reading file .'

Now, I'm not very familiar with Databases/mysql so the reason why it's failed kinda means nothing to me :/ It' might be something super obvious.

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2571
Re: Not connecting to DB
« Reply #1 on: June 09, 2017, 03:45:37 PM »
There are 3  possibilities:

1. You have put in the wrong username/password combination or they gave you the wrong ones.
2. The password has a character in it that messes up python (Make sure it is all alphanumeric).
3. They haven't set the db user up correctly.

Also, you don't seem to have a log file set in up in your xml 


Code: [Select]
<set name="game_log"></set>
[/pre]

Hope that helps!

Offline Whiist

  • Newbie
  • *
  • Posts: 5
Re: Not connecting to DB
« Reply #2 on: June 09, 2017, 04:02:13 PM »
There are 3  possibilities:

1. You have put in the wrong username/password combination or they gave you the wrong ones.
2. The password has a character in it that messes up python (Make sure it is all alphanumeric).
3. They haven't set the db user up correctly.

Also, you don't seem to have a log file set in up in your xml  


Code: [Select]
<set name="game_log"></set>
[/pre]

Hope that helps!


Just set up the game.log now, I'll send in a support ticket to make sure database is correctly done. Password is fine and so is username (It was already set into the xml file & retyped it too..


Will post an update once i find out more.

Offline Whiist

  • Newbie
  • *
  • Posts: 5
Re: Not connecting to DB
« Reply #3 on: June 10, 2017, 12:22:34 AM »
There are 3  possibilities:

1. You have put in the wrong username/password combination or they gave you the wrong ones.
2. The password has a character in it that messes up python (Make sure it is all alphanumeric).
3. They haven't set the db user up correctly.

Also, you don't seem to have a log file set in up in your xml  


Code: [Select]
<set name="game_log"></set>
[/pre]

Hope that helps!
Hey, So it seemed when my B3 bot was moved onto the same box it corrupted the database/broke something. Anyway, that's all fixed but now i get this in my log;

Code: [Select]
Had to post to hastebin because too many characters; https://hastebin.com/kuqotepele.scala

Commands etc don't work, I presume because of this :o






I was also told B3 has issues running with Cod4X, which I've found a tutorial on it I just can't find the two plugins that are required;
B3Hide & simplebanlist

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2571
Re: Not connecting to DB
« Reply #4 on: June 10, 2017, 01:08:36 AM »
Now it looks like your FTP details for the log file are wrong. If they are on the same box you may be able to get away with not using ftp to access the game log, check with the provider.

Those two plugins are cod4x plugins, not b3 plugins, you would need to get them from the cod4x site.

And promod has its own issues with creating the log file, if you do a search for promod on this site you should find some details.

Offline Whiist

  • Newbie
  • *
  • Posts: 5
Re: Not connecting to DB
« Reply #5 on: June 10, 2017, 02:05:20 AM »
Now it looks like your FTP details for the log file are wrong. If they are on the same box you may be able to get away with not using ftp to access the game log, check with the provider.

Those two plugins are cod4x plugins, not b3 plugins, you would need to get them from the cod4x site.

And promod has its own issues with creating the log file, if you do a search for promod on this site you should find some details.
Yeah, I just get this anyway when putting the path with no ftp;

Code: [Select]
170610 00:59:37	BOT    	'Game log /188.165.210.64_28960/mods/smv_promod/games_mp.log'
170610 00:59:37 BOT    'Starting bot reading file \\188.165.210.64_28960\\mods\\smv_promod\\games_mp.log'
170610 00:59:37 ERROR 'Error reading file \\188.165.210.64_28960\\mods\\smv_promod\\games_mp.log'

Going to try with a different mod/default cfg.  As all this is giving me a headache and im not sure if its errors on my part or something else.

Offline Whiist

  • Newbie
  • *
  • Posts: 5
Re: Not connecting to DB
« Reply #6 on: June 10, 2017, 02:35:58 AM »
Now it looks like your FTP details for the log file are wrong. If they are on the same box you may be able to get away with not using ftp to access the game log, check with the provider.

Those two plugins are cod4x plugins, not b3 plugins, you would need to get them from the cod4x site.

And promod has its own issues with creating the log file, if you do a search for promod on this site you should find some details.
Okay.. I think I'm making progress (Needed to add) to my cfg;
Code: [Select]
//****************************************************************
// logging
//****************************************************************
//Logging
set logfile "1"
set g_log "games_mp.log"
 All looks good for that part however , now it's hitting me failed to Auth :|  https://hastebin.com/upejezusim.scala  

Feels like a wild goose chase with problem after problem :/

Offline Pear

  • Newbie
  • *
  • Posts: 2
Re: Not connecting to DB
« Reply #7 on: June 10, 2017, 03:45:58 AM »
b3 builds the playerlist by parsing a rcon 'status' reply, and it looks like you have something not quite right with rcon:
Code: [Select]
170610 01:23:25	VERBOSE	"RCON sending (188.165.210.64:28960) 'fs_game'"
170610 01:23:26 DEBUG 'Get cvar fs_game = [Bad rcon]'

It looks like you're running cod4x, so that means the problem could be one of three things:
  • Your password is incorrect in the config
  • The password is correct but has a/some special character(s) in it that are messing with Python
  • Your password is shorter than 8 characters
cod4x requires that the rcon password be 8 characters or greater, and won't enable rcon if the password doesn't meet that requirement.


Skimming through your log, once you get rcon sorted you will encounter another problem:
Code: [Select]
170610 01:23:57	CONSOLE	'4:14 say;2310346613516301602;0;Ryan;\x15!b3'
The cod4 parser will fail to parse clients from a status in the cod4x format. Make sure in your gameserver config you have the following:

Code: [Select]
sv_legacyguidmode "1"
This setting will force the server to use the 32 character guid in the rcon status and in the games_mp.log
You can then use a cod4x parser to patch certain commands (!unban, !tb) so that they work properly with a cod4x server. You can find one such parser here: https://github.com/ph03n1x9000/CoD4x-parser. Ask your provider if they can provide you with a source install of b3 so you can use the cod4x parser, since it is not distributed with a standard b3 build. Otherwise, you'll encounter more issues when you attempt to unban or tempban players.

Best of luck. :)

 


Rate this page +1 at Google Search

anything