brouznouf / fivem-mysql-async

MySql Async Library for FiveM
MIT License
111 stars 106 forks source link

Server Crashing #146

Open George-RG opened 3 years ago

George-RG commented 3 years ago

Describe the bug I have a highly populated server that sadly it has far more scripts than the recommended amount. The problem is that when the server is under load(over 40 ppl) it crashes after having multiple errors reporting that the SQL is taking too long to respond. I believe its the same issue as the #131 issue but I couldn't find any solution or guidance on how to fix it.

To Reproduce I don't know why it is happening my guess is Heavy load on an already heavy server

Expected behavior I would expect the server to run normally.

Screenshots / Logs I don't have any screenshots but I have the console prints right before the crash

"server thread hitch warning: timer interval of 1197 milliseconds server thread hitch warning: timer interval of 2040 milliseconds server thread hitch warning: timer interval of 3799 milliseconds server thread hitch warning: timer interval of 4146 milliseconds Sending heartbeat to https://servers-ingress-live.fivem.net/ingress [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [jsfour-idcard] [1763ms] SELECT firstname, lastname, dateofbirth, sex, height FROM users WHERE identifier = ? : ["steam:110000141a9bf89"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_status] [4201ms] UPDATE users SET status = ? WHERE identifier = ? : ["[{\"val\":398500,\"percent\":39.85,\"name\":\"hunger\"},{\"val\":343825,\"percent\":34.3825,\"name\":\"thirst\"},{\"val\":0,\"percent\":0.0,\"name\":\"drunk\"},{\"val\":0,\"percent\":0.0,\"name\":\"drug\"}]","steam:110000141d1e98c"] [SAVED] killer server thread hitch warning: timer interval of 926 milliseconds [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [jsfour-idcard] [181ms] SELECT firstname, lastname, dateofbirth, sex, height FROM users WHERE identifier = ? : ["steam:110000141a9bf89"] server thread hitch warning: timer interval of 1568 milliseconds [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [jsfour-idcard] [261ms] SELECT firstname, lastname, dateofbirth, sex, height FROM users WHERE identifier = ? : ["steam:110000141a9bf89"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [jsfour-idcard] [1301ms] SELECT firstname, lastname, dateofbirth, sex, height FROM users WHERE identifier = ? : ["steam:110000141a9bf89"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [258ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","JTQ 967"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [257ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","YVO 636"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [256ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","YAW 838"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [255ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","AUD 816"] server thread hitch warning: timer interval of 2653 milliseconds [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [jsfour-idcard] [2645ms] SELECT firstname, lastname, dateofbirth, sex, height FROM users WHERE identifier = ? : ["steam:110000141a9bf89"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [2634ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","JTQ 967"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [2633ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","YVO 636"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [2632ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","YAW 838"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [2631ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","AUD 816"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [2130ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","JTQ 967"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [2129ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","YVO 636"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [2128ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","YAW 838"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_carlock] [2127ms] SELECT owner FROM owned_vehicles WHERE owner = ? AND plate = ? : ["steam:110000142b05c16","AUD 816"] [Anticheat] Checking their Ban Data [vMenu] [ERROR] [DEBUG LOG] SQLite error: Object reference not set to an instance of an object QUEUE: Insider[steam:1100001194667bc] was placed 1/1 in queue server thread hitch warning: timer interval of 5228 milliseconds [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [kc_admin] [3222ms] SELECT FROM kc_bans WHERE license = ? : ["license:65c0270b73f6d1f5de648a43bbeb1c455be0c85d"] QUEUE: Insider[steam:1100001194667bc] is loading into the server server thread hitch warning: timer interval of 8378 milliseconds server thread hitch warning: timer interval of 11817 milliseconds [txAdminClientLUA] Admin Broadcast - txAdmin: This server is scheduled to restart in 5 minutes. [Anticheat] Checking their Ban Data [vMenu] [ERROR] [DEBUG LOG] SQLite error: Object reference not set to an instance of an object [Anticheat] Checking their Ban Data [vMenu] [ERROR] [DEBUG LOG] SQLite error: Object reference not set to an instance of an object QUEUE: gianniskava[steam:110000118fb3a4a] was placed 1/1 in queue QUEUE: gianniskava[steam:110000118fb3a4a] was placed 1/1 in queue server thread hitch warning: timer interval of 17840 milliseconds MissionLivraisonSelect num 0 MissionLivraisonSelect 1 MissionLivraisonSelect 2 server thread hitch warning: timer interval of 27173 milliseconds Sending heartbeat to https://servers-ingress-live.fivem.net/ingress [txAdminClientJS] Logger upload failed with error: request timed out [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [esx_skin] [37056ms] SELECT skin FROM users WHERE identifier = ? : ["steam:110000142b73cc0"] [MariaDB:10.3.24-MariaDB-1:10.3.24+maria~buster-log] [WARNING] [kc_admin] [35150ms] SELECT FROM kc_bans WHERE license = ? : ["license:d46d4c68a20299ca34ebedcee52c4c7aae8ea014"] [Anticheat] Checking their Ban Data [vMenu] [ERROR] [DEBUG LOG] SQLite error: Object reference not set to an instance of an object

===================================================== FXServer starting - 9/9/2020, 11:57:17 AM

Software:

Additional context I have been trying many ways to fix it but I really cant anymore. Please help me

ghost commented 3 years ago

This happenes because your mysql server closes the connections.

Changing the mysql servers config is the key to success here. I would probably enable the warning log on the mysql server and look from there.

George-RG commented 3 years ago

what should I change in the config? Also, what do you mean about enabling the warning log

George-RG commented 3 years ago

2020-09-09 20:14:24 4259 [Warning] Aborted connection 4259 to db: 'DB' user: 'USER' host: 'HOST' (Got an error reading communication packets)

ghost commented 3 years ago

These often occur when:

Not sure if it also occurs while the connection is needed for other services too. Maybe on the same account?