thankyou
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!

Author Topic: Unable to parse clients  (Read 2610 times)

Offline ph03n1x

  • Sr. Member
  • ****
  • Posts: 296
    • Lovers and Haters Urban Terror
Unable to parse clients
« on: June 20, 2015, 12:39:00 AM »
Hey fellow B3 users, developers and geniuses,

I recently installed a new sof2 server and it seems that B3 is unable to parse the client info.

I get this:
Code: [Select]
CONSOLE	'26:55 ClientConnect: 0 - 47.18.230.29 - ph03n1x'
150620 00:11:35 ERROR 'Parser could not connect client'
150620 00:11:35 CONSOLE '26:55 ClientUserinfoChanged: 0 n\\ph03n1x^7\\t\\0\\identity\\marinesoldier1'
150620 00:11:35 VERBOSE "Parsed user info: {'name': 'ph03n1x^7', 'cid': '0', 'n': 'ph03n1x^7', 't': '0', 'team': 0, 'identity': 'marinesoldier1'}"
150620 00:11:35 ERROR 'Could not parse line \'ip\': [(\'/home/cod/bigbrotherbot-sof2/b3/parser.py\', 1305, \'run\', \'self.parseLine(line)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/q3a/abstractParser.py\', 257, \'parseLine\', \'event = func(action, data, match)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/sof2.py\', 432, \'OnClientuserinfochanged\', "client = self.clients.newClient(bclient[\'cid\'], name=bclient[\'name\'], ip=bclient[\'ip\'],")]'

b3.ini
Code: [Select]
[b3]
# Next line: the parser defines the game (it should NOT be 'changeme'):
#       arma2/arma3
#       bfbc2/bf3/bf4/moh/mohw
#       cod/cod2/cod4/cod4gr/cod5/cod6/cod7/cod8
#       iourt41/iourt42
#       et/etpro/altitude/oa081/smg/smg11/sof2/sof2pm/wop/wop15
#       chiv/csgo/homefront/insurgency/ravaged/ro2/
parser: sof2pm
# Your database info: [protocol]://[db-user]:[db-password]@[db-server[:port]]/[db-name]
database: mysql://b3user:[email protected]/b3sof2
# Name of the bot
bot_name: b3
# Ingame messages are prefixed with this code, you can use colorcodes
bot_prefix: ^2[^0BBZ^2]^3Bot:
# Time format to use to format time strings (also used by the !time command of the Admin Plugin
time_format: %I:%M%p %Z %m/%d/%y
# The timezone your bot is in
time_zone: CEST
# How much detail in the b3 logfile: 9 = verbose, 10 = debug, 21 = bot, 22 = console
log_level: 9
# Name of the logfile the bot will generate
logfile: b3.log
# Comma separated list of plugins that will be loaded in 'disabled' status.
disabled_plugins:
# The directory where additional plugins can be found
external_plugins_dir: @b3/extplugins

[server]
# The RCON pass of your gameserver
rcon_password: alsoasecret
# The port the server is running on
port: 20100
# The gameserver generates a logfile, put the path and name here (very important!)
# If you want to run b3 on a different computer than where your server reside (remote access to the gamelog),
# you can connect via ftp, sftp, or http by using the following syntax:
#       game_log: ftp://username:[email protected]/path/to/games_mp.log
#       game_log: sftp://username:[email protected]/path/to/games_mp.log
#       game_log: http://serverhost/path/to/games_mp.log
game_log: /home/cod/sof2/RPMpro/sof2games.log
# The public IP your gameserver is residing on
public_ip: 37.59.41.60
# The IP the bot can use to send RCON commands to (127.0.0.1 when on the same box)
rcon_ip: 127.0.0.1
# Is the gameserver running PunkBuster anticheat: on/off
punkbuster: off
# Delay between each log reading: set a higher value to consume less disk resources
# or bandwidth if you remotely connect (ftp or http remote log access)
delay: 0.25
# Number of lines to process per second: set a lower value to consume less CPU ressources
lines_per_second: 50

[autodoc]
# Autodoc will generate a user documentation for all B3 commands
#       * type : can be one of : html, htmltable, xml, json
#       * maxlevel : if you want to exclude commands reserved for higher levels
#       * destination : can be a file or a ftp url
# by default, a html documentation is created in your conf folder
type: html
maxlevel: 100
destination: /var/www/commands/sof/index.html
## destination: ftp://user:[email protected]/www/test_doc.html

[update]
# B3 checks if a new version is available at startup.
# Choose here what channel you want to check against.
# Available channels are :
#       stable : will only show stable releases of B3
#       beta : will also check if a beta release is available
#       dev : will also check if a development release is available
#       skip : will skip the update check
# If you don't know what channel to use, use 'stable'.
channel: skip

[messages]
kicked_by: $clientname^7 was kicked by $adminname^7 $reason
kicked: $clientname^7 was kicked $reason
banned_by: $clientname^7 was banned by $adminname^7 $reason
banned: $clientname^7 was banned $reason
temp_banned_by: $clientname^7 was temp banned by $adminname^7 for $banduration^7 $reason
temp_banned: $clientname^7 was temp banned for $banduration^7 $reason
unbanned_by: $clientname^7 was un-banned by $adminname^7 $reason
unbanned: $clientname^7 was un-banned^7 $reason

[plugins]
admin: @conf/plugin_admin.ini
adv: @conf/plugin_adv.xml
banlist: @b3/extplugins/conf/plugin_banlist.xml
censor: @conf/plugin_censor.xml
chatlogger: @conf/plugin_chatlogger.ini
pingwatch: @conf/plugin_pingwatch.ini
pluginmanager: @conf/plugin_pluginmanager.ini
calladmin: @b3/extplugins/calladmin/conf/plugin_calladmin.ini
#asciikick: @b3/extplugins/conf/asciikick.xml
geowelcome: @conf/plugin_geowelcome.ini
proxyfilter: @b3/extplugins/proxyfilter/conf/plugin_proxyfilter.ini
location: @conf/plugin_location.ini
follow: @b3/extplugins/conf/follow.xml
#namechangers: @b3/extplugins/conf/namechangers.xml
translator: @conf/plugin_translator.ini
#weaponhandler: @b3/extplugins/conf/weaponhandler.xml
wideban: @b3/extplugins/conf/wideban.xml
serverrestart: @b3/extplugins/conf/serverrestart.ini

# The following plugins have been included recently in B3 as official
# plugins. They are disabled by default. You can enable them by removing
# the # character at the beginning of the line.

# afk: @conf/plugin_afk.ini
# callvote: @conf/plugin_callvote.ini
# countryfilter: @conf/plugin_countryfilter.ini
# customcommands: @conf/plugin_customcommands.ini
# firstkill: @conf/plugin_firstkill.ini
# ipban: @conf/plugin_ipban.ini
# jumper: @conf/plugin_jumper.ini
# makeroom: @conf/plugin_makeroom.ini
# netblocker: @conf/plugin_netblocker.ini
# nickreg: @conf/plugin_nickreg.ini
# poweradminbf3: @conf/plugin_poweradminbf3.ini
# poweradminbfbc2: @conf/plugin_poweradminbfbc2.ini
# poweradmincod7: @conf/plugin_poweradmincod7.xml
# poweradminhf: @conf/plugin_poweradminhf.ini
# poweradminmoh: @conf/plugin_poweradminmoh.xml
# poweradminurt: @conf/plugin_poweradminurt.ini
# spawnkill: @conf/plugin_spawnkill.ini
# urtserversidedemo: @conf/plugin_urtserversidedemo.ini
# xlrstats: @conf/plugin_xlrstats.ini


Full b3 log: http://pastebin.com/a9W4KSN0

Thank you for assistance!

cu :)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #1 on: June 20, 2015, 01:21:31 AM »
It seems that the hitlocation returned is a negative integer....do you know why this happens? I do not have the game so I can't test myself.
This to me seems more a bug of the game which fails in logging the correct integer value, since the number is always the same. Probably they used an unsigned integer but they are printing to log file using %i or %d which are for signed integers (or smth like that)
« Last Edit: June 20, 2015, 01:30:54 AM by Fenix »

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #2 on: June 20, 2015, 12:29:35 PM »
Alright, I patched the parser to accept a negative hitlocation number. You can get the new version from our github repository (branch release-1.10) or wait for the next daily build to be released

Offline ph03n1x

  • Sr. Member
  • ****
  • Posts: 296
    • Lovers and Haters Urban Terror
Re: Unable to parse clients
« Reply #3 on: June 20, 2015, 03:34:27 PM »
Thanks! I got the bump up patch from Github. It does address the negative hit location, there are no longer errors related to that. However, it's the same issue I had before: B3 is not parsing clients. I think I found the issue, but don;t know how to correct it...

Not entirely sure, but could it be that the line formats do not match?

in parsers/sof2.py
Code: [Select]
  # ClientConnect: <cid> - <ip>:<port> [<guid>]
        re.compile(r'^(?P<action>[a-z]+):\s'
                   r'(?P<data>'
                   r'(?P<cid>[0-9]+)\s-\s'
                   r'(?P<ip>[0-9.]+):'
                   r'(?P<port>[-0-9]+)\s\['
                   r'(?P<cl_guid>[0-9A-Z]{32})\])$', re.IGNORECASE),


Seems to bee looking for that format. However, this is what I see in b3.log:
Code: [Select]
150620 14:54:40	CONSOLE	'910:09 ClientConnect: 4 - 47.18.230.29 - ph03n1x'
150620 14:54:40 ERROR 'Parser could not connect client'
150620 14:54:40 CONSOLE '910:09 ClientUserinfoChanged: 4 n\\ph03n1x^7\\t\\0\\identity\\marinesoldier1'
150620 14:54:40 VERBOSE "Parsed user info: {'name': 'ph03n1x^7', 'cid': '4', 'n': 'ph03n1x^7', 't': '0', 'team': 0, 'identity': 'marinesoldier1'}"
150620 14:54:40 ERROR 'Could not parse line \'ip\': [(\'/home/cod/bigbrotherbot-sof2/b3/parser.py\', 1305, \'run\', \'self.parseLine(line)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/q3a/abstractParser.py\', 257, \'parseLine\', \'event = func(action, data, match)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/sof2.py\', 433, \'OnClientuserinfochanged\', "client = self.clients.newClient(bclient[\'cid\'], name=bclient[\'name\'], ip=bclient[\'ip\'],")]'
150620 14:54:54 CONSOLE '910:24 ClientUserinfoChanged: 4 n\\ph03n1x^7\\t\\0\\identity\\marinesoldier1'
150620 14:54:54 VERBOSE "Parsed user info: {'name': 'ph03n1x^7', 'cid': '4', 'n': 'ph03n1x^7', 't': '0', 'team': 0, 'identity': 'marinesoldier1'}"
150620 14:54:54 ERROR 'Could not parse line \'ip\': [(\'/home/cod/bigbrotherbot-sof2/b3/parser.py\', 1305, \'run\', \'self.parseLine(line)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/q3a/abstractParser.py\', 257, \'parseLine\', \'event = func(action, data, match)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/sof2.py\', 433, \'OnClientuserinfochanged\', "client = self.clients.newClient(bclient[\'cid\'], name=bclient[\'name\'], ip=bclient[\'ip\'],")]'
150620 14:54:55 CONSOLE '910:24 ClientUserinfoChanged: 4 n\\ph03n1x^7\\t\\0\\identity\\marinesoldier2'
150620 14:54:55 VERBOSE "Parsed user info: {'name': 'ph03n1x^7', 'cid': '4', 'n': 'ph03n1x^7', 't': '0', 'team': 0, 'identity': 'marinesoldier2'}"
150620 14:54:55 ERROR 'Could not parse line \'ip\': [(\'/home/cod/bigbrotherbot-sof2/b3/parser.py\', 1305, \'run\', \'self.parseLine(line)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/q3a/abstractParser.py\', 257, \'parseLine\', \'event = func(action, data, match)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/sof2.py\', 433, \'OnClientuserinfochanged\', "client = self.clients.newClient(bclient[\'cid\'], name=bclient[\'name\'], ip=bclient[\'ip\'],")]'
150620 14:54:55 CONSOLE '910:24 ClientBegin: 4'

Notice that there is no GUID in the connect event. Don't know what can be causing that though.
It says that it cannot parse line 433 in sof2.py which is about creating a new client record. The guid is needed for the client record to be created.

Am I on the right track? If so, do you have any idea what can cause this?


cu :)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #4 on: June 20, 2015, 06:00:31 PM »
Please update your B3 to the latest daily release. A bug in the Clientuserinfochanged parsing has been addressed already. If you still have problems with the latest daily build, post a new full b3.log

Offline ph03n1x

  • Sr. Member
  • ****
  • Posts: 296
    • Lovers and Haters Urban Terror
Re: Unable to parse clients
« Reply #5 on: June 20, 2015, 11:55:26 PM »
Hey Master Fenix,

Thanks for your help with this matter. Unfortunately the update to the latest build is kind of difficult because I keep getting a bunch of errors when trying to meet the dependencies.
The OS is Debian 7 which does not install pyQt5 from the repo (even though it is listed in the repo) so I have to install manually. After installing pyQt5, I came across more errors. Took me quite a while to do all this because I had to manually install some dependencies...pyQt5 by itself took a long time to complete. I will try to upgrade again when I have the time to, but I cannot give the large amount of time it seems to require to do the upgrade today. Sometimes RL is too busy to spend a lot of time on upgrades... I will keep you posted on any progress.

Thanks again!

cu :)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #6 on: June 20, 2015, 11:58:32 PM »
PyQT is needed only if you start B3 from your computer. If u use a server use the --console argument when starting B3 and everything will go back to normal

EDIT: also , if you do not install pyqt it should fallback to console mode
« Last Edit: June 21, 2015, 12:00:36 AM by Fenix »

Offline ph03n1x

  • Sr. Member
  • ****
  • Posts: 296
    • Lovers and Haters Urban Terror
Re: Unable to parse clients
« Reply #7 on: June 21, 2015, 12:20:09 AM »
It's not a problem installing pyQt5 (even if manually), the thing is that doing that only creates another problem. Uninstalling pyQt5 gives this error again:

Code: [Select]
$ python b3_run.py -c /home/cod/bigbrotherbot-sof2/b3/conf/b3.ini --console
Traceback (most recent call last):
  File "b3_run.py", line 40, in <module>
    import b3.run
  File "/home/cod/bigbrotherbot-sof2/b3/run.py", line 36, in <module>
    from PyQt5.QtWidgets import QSpacerItem, QSizePolicy
ImportError: libQt5Widgets.so.5: cannot open shared object file: No such file or directory


:(

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #8 on: June 21, 2015, 12:22:50 AM »
Weird. I'll give it a try myself and get beck to you

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #9 on: June 21, 2015, 12:43:21 AM »
Found the issue. I made a typo :) Pushing a fix right now

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #10 on: June 21, 2015, 12:49:06 AM »
Tested right now. Last github release-1.10 version works perfectly ^^

Code: [Select]
Starting B3      : www.bigbrotherbot.net (b3) v1.10.0 [posix] [AngryBiscuit]
Autorestart mode : OFF
Checking update  : no update available
Loading config   : @conf/b3_jump.xml
Loading parser   : iourt42
Activating log   : ~/resources/bigbrotherbot/b3_jump.log
Connecting to DB : OK
Using gamelog    : ~/jump/urbanterror/q3ut4/jump.log
Testing RCON     : OK
Loading events   : 42 events loaded
Loading plugins  : ................... (19)
Starting plugins : ................... (19)
Startup complete : B3 is running! Let's get to work!

If you run into problems check your B3 log file for more information

Offline ph03n1x

  • Sr. Member
  • ****
  • Posts: 296
    • Lovers and Haters Urban Terror
Re: Unable to parse clients
« Reply #11 on: June 22, 2015, 03:26:17 PM »
Ok, that fixed the issue with B3 being unable to start due to pyQt5. Thanks for that!

However, for some reason I;m still getting the error:
Code: [Select]
150622 14:11:07	CONSOLE	'1:44 ClientConnect: 4 - 47.18.230.29 - ph03n1x'
150622 14:11:07 ERROR 'Parser could not connect client'
150622 14:11:07 CONSOLE '1:44 ClientUserinfoChanged: 4 n\\ph03n1x^7\\t\\0\\identity\\marinesoldier1'
150622 14:11:07 VERBOSE "Parsed user info: {'name': 'ph03n1x^7', 'cid': '4', 'n': 'ph03n1x^7', 't': '0', 'team': 0, 'identity': 'marinesoldier1'}"
150622 14:11:07 ERROR 'Could not parse line argument of type \'NoneType\' is not iterable: [(\'/home/cod/bigbrotherbot-sof2/b3/parser.py\', 1315, \'run\', \'self.parseLine(line)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/q3a/abstractParser.py\', 257, \'parseLine\', \'event = func(action, data, match)\'), (\'/home/cod/bigbrotherbot-sof2/b3/parsers/sof2.py\', 435, \'OnClientuserinfochanged\', "data={\'guid\': bclient[\'cl_guid\']})"), (\'/home/cod/bigbrotherbot-sof2/b3/clients.py\', 1618, \'newClient\', \'client = Client(console=self.console, cid=cid, timeAdd=self.console.time(), **kwargs)\'), (\'/home/cod/bigbrotherbot-sof2/b3/clients.py\', 178, \'__init__\', \'setattr(self, k, v)\'), (\'/home/cod/bigbrotherbot-sof2/b3/clients.py\', 512, \'_set_ip\', "if \':\' in ip:")]'

No commands work at all, I do see advertisements for adv plugin. I also see chat in b3 log..but there is no client attached to the messages because it is not parsing clients.

B3.log : http://pastebin.com/AsGpaW7C


???

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #12 on: June 22, 2015, 03:28:54 PM »
I'll have a look later in the afternoon


Inviato dal mio iPhone utilizzando Tapatalk

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 999
    • GitHub
Re: Unable to parse clients
« Reply #13 on: June 22, 2015, 04:37:04 PM »
Which version of SOF are you using? The log lines being shown in your log file are completely different from the ones B3 can parse. On the ClientConnect the GUID is missing too, so how is B3 supposed to recognize you?

Offline ph03n1x

  • Sr. Member
  • ****
  • Posts: 296
    • Lovers and Haters Urban Terror
Re: Unable to parse clients
« Reply #14 on: June 22, 2015, 05:13:52 PM »
Using sof2 server v1.00. Just a few minutes before posting this, I finally found a forum with some info that says v1.00 doesn't have GUIDs..bad thing is that there are some custom maps that only work with 1.00 (as far as I understand from another server admin). Anyways, this means that it is not a problem that can be fixed by modifying something in B3 and therefore is not a B3 issue.

Thanks for your time, Fenix!

Appreciate the help!

cu :)

 


Rate this page +1 at Google Search

anything