BigBrotherBot/big-brother-bot

DB conntion ERROR

Ghost173 opened this issue · 10 comments

suddenly am getting this error
note: b3 working fine but suddnly its happen how to fix this ?

200508 01:45:50 ERROR 'Database connection failed: working in remote mode: 255 - [(\'/home/rider/b3/big-brother-bot-master/b3/storage/mysql.py\', 287, \'connect\', \'charset="utf8")\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/__init__.py\', 88, \'Connect\', \'return Connection(*args, **kwargs)\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/connections.py\', 644, \'__init__\', \'self._connect()\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/connections.py\', 837, \'_connect\', \'self._get_server_information()\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/connections.py\', 1072, \'_get_server_information\', \'self.server_charset = charset_by_id(lang).name\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/charset.py\', 34, \'by_id\', \'return self._by_id[id]\')]'

Looks like the mysql server may have stopped for some reason.

hi

MySQL server is running

Last login: Fri May 15 23:28:15 2020 from 175.157.41.224
root@rider:~# sudo service mysql status
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
   Active: active (running) since Fri 2020-05-08 00:48:17 +0530; 1 weeks 4 days 
 Main PID: 1075 (mysqld)
   Status: "Server is operational"
    Tasks: 47 (limit: 2287)
   Memory: 637.7M
   CGroup: /system.slice/mysql.service
           └─1075 /usr/sbin/mysqld

May 08 00:48:16 rider systemd[1]: Starting MySQL Community Server...
May 08 00:48:17 rider systemd[1]: Started MySQL Community Server.

In that case define "suddenly" ie after running for some time, after a restart etc

i try but not working :(

That isn't any more detail. Describe EXACTLY what you are doing and what is happening.

here is the log file

200508 01:45:50 BOT      'www.bigbrotherbot.net (b3) v1.12 [^IronPigeon]'
200508 01:45:50 BOT      'Python: 2.7.17 (default, Nov  7 2019, 10:07:09) [GCC 9.2.1 20191008]'
200508 01:45:50 BOT      'Default encoding: ascii'
200508 01:45:50 BOT      'Starting Cod4X18Parser v0.2 for server 45.32.113.186:28960 (autorestart = OFF)'
200508 01:45:50 BOT      '--------------------------------------------'
200508 01:45:50 BOT      'Connecting to MySQL database: mysql://root:******@localhost:3306/new_tdm_b3...'
200508 01:45:50 ERROR    'Database connection failed: working in remote mode: 255 - [(\'/home/rider/b3/big-brother-bot-master/b3/storage/mysql.py\', 287, \'connect\', \'charset="utf8")\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/__init__.py\', 88, \'Connect\', \'return Connection(*args, **kwargs)\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/connections.py\', 644, \'__init__\', \'self._connect()\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/connections.py\', 837, \'_connect\', \'self._get_server_information()\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/connections.py\', 1072, \'_get_server_information\', \'self.server_charset = charset_by_id(lang).name\'), (\'/usr/local/lib/python2.7/dist-packages/pymysql/charset.py\', 34, \'by_id\', \'return self._by_id[id]\')]'
200508 01:45:50 BOT      'Game log is: /home/rider/serverfiles/main/games_mp.log'
200508 01:45:50 BOT      u'Starting bot reading file: /home/rider/serverfiles/main/games_mp.log'
200508 01:45:50 BOT      'Rcon status cache expire time: [2 sec] Type: [False]'
200508 01:45:50 BOT      'Game name is: cod4'
200508 01:45:50 VERBOSE  "RCON sending (45.32.113.186:28960) 'status'"
200508 01:45:51 BOT      u'Loading plugins (external plugin directory: /home/rider/b3/big-brother-bot-master/b3/extplugins)'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_admin.ini for plugin admin'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_adv.xml for plugin adv'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_censor.xml for plugin censor'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_cmdmanager.ini for plugin cmdmanager'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_pingwatch.ini for plugin pingwatch'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_pluginmanager.ini for plugin pluginmanager'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_punkbuster.ini for plugin punkbuster'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_spamcontrol.ini for plugin spamcontrol'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_stats.ini for plugin stats'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_status.ini for plugin status'
200508 01:45:51 BOT      u'Loading configuration file /home/rider/b3/big-brother-bot-master/b3/conf/plugin_welcome.ini for plugin welcome'
200508 01:45:51 BOT      'Sorting plugins according to their dependency tree...'
200508 01:45:51 BOT      'Ready to create plugin instances: admin, adv, censor, cmdmanager, pingwatch, pluginmanager, punkbuster, spamcontrol, stats, status, welcome'
200508 01:45:51 BOT      u'Loading plugin #1 : admin [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_admin.ini]'
200508 01:45:51 DEBUG    'AdminPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'AdminPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'AdminPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'AdminPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin admin (1.35 - ThorN, xlr8or, Courgette, Ozon, Fenix) loaded'
200508 01:45:51 BOT      u'Loading plugin #2 : adv [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_adv.xml]'
200508 01:45:51 DEBUG    'AdvPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'AdvPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'AdvPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'AdvPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin adv (1.6.1 - ThorN) loaded'
200508 01:45:51 BOT      u'Loading plugin #3 : censor [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_censor.xml]'
200508 01:45:51 DEBUG    'CensorPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'CensorPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'CensorPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'CensorPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin censor (3.3 - ThorN, xlr8or, Bravo17, Courgette) loaded'
200508 01:45:51 BOT      u'Loading plugin #4 : cmdmanager [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_cmdmanager.ini]'
200508 01:45:51 DEBUG    'CmdmanagerPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'CmdmanagerPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'CmdmanagerPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'CmdmanagerPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin cmdmanager (1.4 - Fenix) loaded'
200508 01:45:51 BOT      u'Loading plugin #5 : pingwatch [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_pingwatch.ini]'
200508 01:45:51 DEBUG    'PingwatchPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'PingwatchPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'PingwatchPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'PingwatchPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin pingwatch (1.4 - ThorN) loaded'
200508 01:45:51 BOT      u'Loading plugin #6 : pluginmanager [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_pluginmanager.ini]'
200508 01:45:51 DEBUG    'PluginmanagerPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'PluginmanagerPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'PluginmanagerPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'PluginmanagerPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin pluginmanager (1.2 - Fenix) loaded'
200508 01:45:51 BOT      u'Loading plugin #7 : punkbuster [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_punkbuster.ini]'
200508 01:45:51 DEBUG    'PunkbusterPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'PunkbusterPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'PunkbusterPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'PunkbusterPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin punkbuster (1.3 - ThorN) loaded'
200508 01:45:51 BOT      u'Loading plugin #8 : spamcontrol [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_spamcontrol.ini]'
200508 01:45:51 DEBUG    'SpamcontrolPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'SpamcontrolPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'SpamcontrolPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'SpamcontrolPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin spamcontrol (1.4.4 - ThorN, Courgette) loaded'
200508 01:45:51 BOT      u'Loading plugin #9 : stats [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_stats.ini]'
200508 01:45:51 DEBUG    'StatsPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'StatsPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'StatsPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'StatsPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin stats (1.5.1 - ThorN, GrosBedo) loaded'
200508 01:45:51 BOT      u'Loading plugin #10 : status [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_status.ini]'
200508 01:45:51 DEBUG    'StatusPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'StatusPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'StatusPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'StatusPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin status (1.6.5 - ThorN) loaded'
200508 01:45:51 BOT      u'Loading plugin #11 : welcome [/home/rider/b3/big-brother-bot-master/b3/conf/plugin_welcome.ini]'
200508 01:45:51 DEBUG    'WelcomePlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'WelcomePlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'WelcomePlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'WelcomePlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin welcome (1.4 - ThorN, xlr8or, Courgette) loaded'
200508 01:45:51 BOT      'Loading plugin : publist'
200508 01:45:51 DEBUG    'PublistPlugin: register event <Stop Process>'
200508 01:45:51 DEBUG    'PublistPlugin: created event mapping: <Stop Process:onStop>'
200508 01:45:51 DEBUG    'PublistPlugin: register event <Program Exit>'
200508 01:45:51 DEBUG    'PublistPlugin: created event mapping: <Program Exit:onExit>'
200508 01:45:51 BOT      'Plugin publist (1.14 - ThorN, Courgette) loaded'
200508 01:45:51 DEBUG    'Creating the event queue with size 50'
200508 01:45:51 BOT      'Starting parser..'
200508 01:45:51 VERBOSE  "RCON sending (45.32.113.186:28960) 'sv_usesteam64id  1'"
200508 01:45:52 VERBOSE  "RCON sending (45.32.113.186:28960) 'plugininfo b3hide'"
200508 01:45:53 VERBOSE  "RCON sending (45.32.113.186:28960) 'say ^0(^2b3^0)^7: ^8www.bigbrotherbot.net ^0(^8b3^0) ^9v1.12'"
200508 01:45:53 INFO     'AdminPlugin: ------ loading warn_reasons from config file ------'
200508 01:45:53 INFO     "AdminPlugin: warn reason 'default': (60.0, '^7behave yourself')"
200508 01:45:53 INFO     "AdminPlugin: warn reason 'generic': (60.0, '^7')"
200508 01:45:53 INFO     'AdminPlugin: rule9      3 hours   \t"^3Rule #9: Do ^1NOT ^3fire at teammates or within 10 seconds of spawning" '
200508 01:45:53 INFO     'AdminPlugin: rule8      3 days    \t"^3Rule #8: No profanity or offensive language (in any language)" '
200508 01:45:53 INFO     'AdminPlugin: rule3      1 day     \t"^3Rule #3: No arguing with admins (listen and learn or leave)" '
200508 01:45:53 INFO     'AdminPlugin: rule2      1 day     \t"^3Rule #2: No clan stacking, members must split evenly between the teams" '
200508 01:45:53 INFO     'AdminPlugin: rule1      1.4 week  \t"^3Rule #1: No racism of any kind" '
200508 01:45:53 INFO     'AdminPlugin: rule7      1 day     \t"^3Rule #7: No advertising or spamming of websites or servers" '
200508 01:45:53 INFO     'AdminPlugin: rule6      1 day     \t"^3Rule #6: No recruiting for your clan, your server, or anything else" '
200508 01:45:53 INFO     'AdminPlugin: rule5      1 hour    \t"^3Rule #5: No offensive or potentially offensive names, annoying names, or in-game (double caret (^)) color in names" '
200508 01:45:53 INFO     'AdminPlugin: rule4      1 day     \t"^3Rule #4: No abusive language or behavior towards admins or other players" '
200508 01:45:53 INFO     'AdminPlugin: adv        1 day     \t"^3Rule #7: No advertising or spamming of websites or servers" '
200508 01:45:53 INFO     'AdminPlugin: afk        5 minutes \t"^7you appear to be away from your keyboard" '
200508 01:45:53 INFO     'AdminPlugin: generic    1 hour    \t"^7" '
200508 01:45:53 INFO     'AdminPlugin: ci         5 minutes \t"^7connection interupted, reconnect" '
200508 01:45:53 INFO     'AdminPlugin: racism     1.4 week  \t"^3Rule #1: No racism of any kind" '
200508 01:45:53 INFO     'AdminPlugin: color      1 hour    \t"^7No in-game (double caret (^)) color in names" '
200508 01:45:53 INFO     'AdminPlugin: fakecmd    1 hour    \t"^7do not use fake commands" '
200508 01:45:53 INFO     'AdminPlugin: tk         1 day     \t"^7stop team killing!" '
200508 01:45:53 INFO     'AdminPlugin: nocmd      1 hour    \t"^7do not use commands that you do not have access to, try using !help" '
200508 01:45:53 INFO     'AdminPlugin: spec       5 minutes \t"^7spectator too long on full server" '
200508 01:45:53 INFO     'AdminPlugin: spawnfire  3 hours   \t"^3Rule #9: Do ^1NOT ^3fire at teammates or within 10 seconds of spawning" '
200508 01:45:53 INFO     'AdminPlugin: cuss       3 days    \t"^3Rule #8: No profanity or offensive language (in any language)" '
200508 01:45:53 INFO     'AdminPlugin: jerk       1 day     \t"^3Rule #4: No abusive language or behavior towards admins or other players" '
200508 01:45:53 INFO     'AdminPlugin: sfire      3 hours   \t"^3Rule #9: Do ^1NOT ^3fire at teammates or within 10 seconds of spawning" '
200508 01:45:53 INFO     'AdminPlugin: spam       1 hour    \t"^7do not spam, shut-up!" '
200508 01:45:53 INFO     'AdminPlugin: rule10     3 days    \t"^3Rule #10: Offense players must play for the objective and support their team" '
200508 01:45:53 INFO     'AdminPlugin: stack      1 day     \t"^3Rule #2: No clan stacking, members must split evenly between the teams" '
200508 01:45:53 INFO     'AdminPlugin: lang       3 days    \t"^3Rule #8: No profanity or offensive language (in any language)" '
200508 01:45:53 INFO     'AdminPlugin: obj        1 hour    \t"^7go for the objective!" '
200508 01:45:53 INFO     'AdminPlugin: name       1 hour    \t"^3Rule #5: No offensive or potentially offensive names, annoying names, or in-game (double caret (^)) color in names" '
200508 01:45:53 INFO     'AdminPlugin: language   3 days    \t"^3Rule #8: No profanity or offensive language (in any language)" '
200508 01:45:53 INFO     'AdminPlugin: default    1 hour    \t"^7behave yourself" '
200508 01:45:53 INFO     'AdminPlugin: profanity  3 days    \t"^3Rule #8: No profanity or offensive language (in any language)" '
200508 01:45:53 INFO     'AdminPlugin: camp       1 hour    \t"^7stop camping or you will be kicked!" '
200508 01:45:53 INFO     'AdminPlugin: recruit    1 day     \t"^3Rule #6: No recruiting for your clan, your server, or anything else" '
200508 01:45:53 INFO     'AdminPlugin: badname    1 hour    \t"^7No offensive, potentially offensive, or annoying names" '
200508 01:45:53 INFO     'AdminPlugin: spectator  5 minutes \t"^7spectator too long on full server" '
200508 01:45:53 INFO     'AdminPlugin: argue      1 day     \t"^3Rule #3: No arguing with admins (listen and learn or leave)" '
200508 01:45:53 INFO     'AdminPlugin: -------------- warn_reasons loaded ----------------'
200508 01:45:53 DEBUG    'AdminPlugin: loaded warn/warn_delay: 15'
200508 01:45:53 DEBUG    'AdminPlugin: loaded warn/instant_kick_num: 5'
200508 01:45:53 DEBUG    'AdminPlugin: loaded warn/alert_kick_num: 3'
200508 01:45:53 DEBUG    'AdminPlugin: loaded warn/warn_command_abusers: False'
200508 01:45:53 BOT      'New MySQL database connection requested but last connection attempt failed less than 60 seconds ago: exiting...'
200508 01:45:53 INFO     "STDOUT 'ERROR: lost connection with the storage layer during query'"
200508 01:45:53 INFO     "STDOUT '\\n'"
200508 01:45:53 ERROR    "STDERR 'Traceback (most recent call last):\\n'"
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/__init__.py", line 328, in start\\n\''
200508 01:45:53 ERROR    "STDERR '    console.start()\\n'"
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/parser.py", line 470, in start\\n\''
200508 01:45:53 ERROR    "STDERR '    self.call_plugins_onLoadConfig()\\n'"
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/parser.py", line 841, in call_plugins_onLoadConfig\\n\''
200508 01:45:53 ERROR    "STDERR '    p.onLoadConfig()\\n'"
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/plugins/admin/__init__.py", line 150, in onLoadConfig\\n\''
200508 01:45:53 ERROR    'STDERR "    self._noreason_level = self.console.getGroupLevel(self.config.get(\'settings\', \'noreason_level\'))\\n"'
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/parser.py", line 1067, in getGroupLevel\\n\''
200508 01:45:53 ERROR    "STDERR '    group = self.getGroup(data)\\n'"
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/decorators.py", line 82, in __call__\\n\''
200508 01:45:53 ERROR    "STDERR '    res = cache[key] = self.func(*args, **kw)\\n'"
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/parser.py", line 1059, in getGroup\\n\''
200508 01:45:53 ERROR    "STDERR '    return self.storage.getGroup(g)\\n'"
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/storage/common.py", line 553, in getGroup\\n\''
200508 01:45:53 ERROR    "STDERR '    cursor = self.query(query)\\n'"
200508 01:45:53 ERROR    'STDERR \'  File "/home/rider/b3/big-brother-bot-master/b3/storage/common.py", line 627, in query\\n\''
200508 01:45:53 ERROR    'STDERR "    raise Exception(\'lost connection with the storage layer during query\')\\n"'
200508 01:45:53 ERROR    "STDERR 'Exception: lost connection with the storage layer during query\\n'"
200508 01:45:53 BOT      'Shutting down...'
200508 01:45:53 INFO     'StatusPlugin: B3 stop/exit.. updating status'
200508 01:45:53 DEBUG    'StatusPlugin: writing XML status to ~/status.xml'
200508 01:45:53 ERROR    "[Errno 2] No such file or directory: '~/status.xml'"

Right at line 6 you are not able to connect to the database, you need to check your connection details.

Also, your log is from 8th May, the post showing Mysql was working was from a week later which doesn't show that it was working when the log was made.

this y i ask here my db connection details are correct and it's working fine suddenly its happen

Have you restarted everything and tried again?

Hi, @Ghost173 check your PHP version. I also have the same issue. PHP version should be 5.6 like that. upper version not supported to b3.