Raised This Month: $12 Target: $400
 3% 

Connection issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elfenlied ftw
Member
Join Date: Aug 2012
Old 10-08-2016 , 22:40   Connection issues
Reply With Quote #1

I am having difficulty getting sourcebans 1.5.4.7 to work. My issue is with the game module failing to connect to the database. I am running Centos 7.2.

sourcebans.log:
Code:
L 10/09/2016 - 02:00:52: [sourcebans.smx] Database failure: [2002]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2). See FAQ: https://sarabveer.github.io/SourceBans-Fork/faq/
The link above is a 404.

errors_20161009.log:
Code:
L 10/09/2016 - 02:00:43: Error log file session closed.
L 10/09/2016 - 02:00:52: SourceMod error session started
L 10/09/2016 - 02:00:52: Info (map "ctf_2fort") (file "errors_20161009.log")
L 10/09/2016 - 02:00:52: [SM] Exception reported: Failed to connect to SourceBans DB, [2002]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
L 10/09/2016 - 02:00:52: [SM] Blaming: sbchecker.smx
L 10/09/2016 - 02:00:52: [SM] Call stack trace:
L 10/09/2016 - 02:00:52: [SM]   [0] SetFailState
L 10/09/2016 - 02:00:52: [SM]   [1] Line 76, sbchecker.sp::OnDatabaseConnected
L 10/09/2016 - 02:00:58: [SM] Exception reported: Invalid database Handle 0 (error: 4)
L 10/09/2016 - 02:00:58: [SM] Blaming: SourceSleuth.smx
L 10/09/2016 - 02:00:58: [SM] Call stack trace:
L 10/09/2016 - 02:00:58: [SM]   [0] SQL_TQuery
L 10/09/2016 - 02:00:58: [SM]   [1] Line 168, SourceSleuth.sp::OnClientPostAdminCheck
L 10/09/2016 - 02:00:58: [sourcecomms.smx] Connecting to database failed: [2002]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
databases.cfg:
Code:
"sourcebans"
	{
		"driver"			"mysql"
		"host"				"/var/lib/mysql/mysql.sock"
		"database"			"sourcebans"
		"user"				"sbuser"
		"pass"				"*redacted*"
		//"timeout"			"0"
		"port"			"3306"
	}
I have tried using 127.0.0.1, localhost, /var/lib/mysql/mysql.sock, and /tmp/mysql.sock (which I linked). None of these have worked.


/etc/my.cnf.d/server.cnf
Code:
[mysqld]
port = 3306
bind-address = 0.0.0.0 # have tried 127.0.0.1 too, no effect
max_allowed_packet=16M
socket=/var/lib/mysql/mysql.sock
datadir=/var/lib/mysql/
user=mysql
group=mysql
permissions for /var/lib/mysql and /var/lib/mysql/mysql.sock
these are default and I have not changed these:
Code:
[root@vps ~]# stat /var/lib/mysql
  File: ‘/var/lib/mysql’
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: ca02h/51714d    Inode: 262724      Links: 9
Access: (0755/drwxr-xr-x)  Uid: (   27/   mysql)   Gid: (   27/   mysql)
Access: 2016-10-08 20:04:10.399968916 -0500
Modify: 2016-10-08 20:52:32.376776572 -0500
Change: 2016-10-08 20:52:32.376776572 -0500
 Birth: -
 
 
[root@vps ~]# stat /var/lib/mysql/mysql.sock
  File: ‘/var/lib/mysql/mysql.sock’
  Size: 0               Blocks: 0          IO Block: 4096   socket
Device: ca02h/51714d    Inode: 262549      Links: 1
Access: (0777/srwxrwxrwx)  Uid: (   27/   mysql)   Gid: (   27/   mysql)
Access: 2016-10-08 20:52:33.203781669 -0500
Modify: 2016-10-08 20:52:32.376776572 -0500
Change: 2016-10-08 20:52:32.376776572 -0500
 Birth: -
I have manually logged in to mysql to verify the username and password work, and they do.
Code:
[root@vps ~]# mysql -usbuser -p*redacted*
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 5.5.50-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use sourcebans;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [sourcebans]> show tables;
+--------------------------+
| Tables_in_sourcebans     |
+--------------------------+
| sb_admins                |
| sb_admins_servers_groups |
| sb_banlog                |
| sb_bans                  |
| sb_comments              |
| sb_comms                 |
| sb_demos                 |
| sb_groups                |
| sb_log                   |
| sb_mods                  |
| sb_overrides             |
| sb_protests              |
| sb_servers               |
| sb_servers_groups        |
| sb_settings              |
| sb_srvgroups             |
| sb_srvgroups_overrides   |
| sb_submissions           |
+--------------------------+
18 rows in set (0.00 sec)

MariaDB [sourcebans]> exit
Bye



I have no idea what I'm doing wrong here. I tried everything I listed above to no avail. I tried searching these forums and google and found nothing but people saying to search (pretty ironic, huh?). I have also tried adding an exception in firewalld which had no effect. Any assistance would be appreciated.



Thanks in advance.
elfenlied ftw is offline
elfenlied ftw
Member
Join Date: Aug 2012
Old 10-08-2016 , 23:45   Re: Connection issues
Reply With Quote #2

I also tried connecting to the socket via the command line and it worked.

Code:
[root@vps my.cnf.d]# mysql -usbuser -S /var/lib/mysql/mysql.sock  -p*redacted*
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.1.18-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use sourcebans; show tables;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
+--------------------------+
| Tables_in_sourcebans     |
+--------------------------+
| sb_admins                |
| sb_admins_servers_groups |
| sb_banlog                |
| sb_bans                  |
| sb_comments              |
| sb_comms                 |
| sb_demos                 |
| sb_groups                |
| sb_log                   |
| sb_mods                  |
| sb_overrides             |
| sb_protests              |
| sb_servers               |
| sb_servers_groups        |
| sb_settings              |
| sb_srvgroups             |
| sb_srvgroups_overrides   |
| sb_submissions           |
+--------------------------+
18 rows in set (0.00 sec)

MariaDB [sourcebans]> quit
Bye


I have no idea why this isn't working.

Last edited by DarkDeviL; 10-15-2016 at 20:27. Reason: Do not blank out posts - if you solve your problem post the solution for others to find.
elfenlied ftw is offline
elfenlied ftw
Member
Join Date: Aug 2012
Old 10-09-2016 , 00:03   Re: Connection issues
Reply With Quote #3

If I use my public IP it works fine, but using anything local doesn't work.

Last edited by DarkDeviL; 10-15-2016 at 20:27. Reason: Do not blank out posts - if you solve your problem post the solution for others to find.
elfenlied ftw is offline
Cooky
Veteran Member
Join Date: Jun 2010
Location: 127.0.0.1
Old 10-11-2016 , 07:51   Re: Connection issues
Reply With Quote #4

Please share your solution for future requests.
Cooky is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 10-15-2016 , 20:29   Re: Connection issues
Reply With Quote #5

Your posts for this threads has been restored.

Another time, follow the AlliedModders Rules:

Quote:
Do not blank out posts - if you solve your problem post the solution for others to find.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode