HereAuth icon indicating copy to clipboard operation
HereAuth copied to clipboard

MySQLLoadPlayerTask: Task crashed

Open aquaminer opened this issue 8 years ago • 19 comments

@SOF3, @PEMapModder A very interesting bug, similar to #73. It is displayed for the reason of disconnecting via timeout.

Warning: Error while sending QUERY packet. PID=18336 in /root/*******/plugins/HereAuth-master/src/HereAuth/Database/MySQL/MySQLSavePlayerTask.php on line 38
[Tesseract] [18:25:38] INFO> opkiler22789 вышел из игры
[Tesseract] [18:25:38] INFO> opkiler22789[/95.46.157.19:19132] отключился: timeout

[Tesseract] [18:26:07] CRITICAL> Error: "Call to a member function fetch_assoc() on boolean" (EXCEPTION) in "/plugins/HereAuth-master/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask" at line 40
[Tesseract] [18:26:07] INFO> opkiler22789[/95.46.157.19:19132] вошел с id сущности -6712286032986211513 на (2, world, 256, 65)
[Tesseract] [18:26:07] CRITICAL> Could not execute asynchronous task MySQLLoadPlayerTask: Task crashed

Accordingly, authorization is lost

aquaminer avatar Mar 31 '17 15:03 aquaminer

Situations are even more interesting ... It's enough for one player to disconnect through timeout. And all the rest will pass without authorization

[Tesseract] [18:48:56] CRITICAL> Error: "Call to a member function fetch_assoc() on boolean" (EXCEPTION) in "/plugins/HereAuth-master/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask" at line 40
[Tesseract] [18:48:56] INFO> phx[/95.46.157.19:1024] вошел с id сущности 4709938578854418348 на (2, world, 215.7194, 64)
[Tesseract] [18:48:56] CRITICAL> Could not execute asynchronous task MySQLLoadPlayerTask: Task crashed
[Tesseract] [18:48:58] INFO> [EssentialsPE] Running
[Tesseract] [18:48:58] INFO> phx присоединился к игре
[Tesseract] [18:49:26] INFO> phx вышел из игры
[Tesseract] [18:49:26] INFO> phx[/95.46.157.19:1024] отключился: client disconnect
[Tesseract] [18:49:28] INFO> opkiler22789 вышел из игры
[Tesseract] [18:49:28] INFO> opkiler22789[/95.46.157.19:19132] отключился: timeout
[Tesseract] [18:49:34] CRITICAL> Error: "Call to a member function fetch_assoc() on boolean" (EXCEPTION) in "/plugins/HereAuth-master/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask" at line 40
[Tesseract] [18:49:34] INFO> phx[/95.46.157.19:1024] вошел с id сущности 4709938578854418348 на (3, world, 215.7194, 64)
[Tesseract] [18:49:34] CRITICAL> Could not execute asynchronous task MySQLLoadPlayerTask: Task crashed

aquaminer avatar Mar 31 '17 15:03 aquaminer

Maybe it's because you are using Tesseract

Matthww avatar Apr 19 '17 12:04 Matthww

@Matthww, What do you propose to put then? It's not difficult for me to test

aquaminer avatar Apr 19 '17 12:04 aquaminer

This issue is valid. HereAuth is responsible for checking whether the query succeeded and outputting the error. Nothing to do with the server software.

SOF3 avatar Apr 19 '17 14:04 SOF3

HereAuth working fine for me

xXNiceYT avatar Apr 19 '17 19:04 xXNiceYT

This issue happens when there is something wrong with your database connection, e.g. permissions, wrong login config, etc. HereAuth is not responsible for actually fixing such problems, but it is responsible for gracefully reporting such problems to the user.

SOF3 avatar Apr 20 '17 01:04 SOF3

@SOF3 ...or not. MySQLiResult returns boolean when the result does not exist.

Muqsit avatar Apr 20 '17 10:04 Muqsit

@Muqsit, @SOF3, I can provide values ​​in the config

aquaminer avatar Apr 20 '17 10:04 aquaminer

@musqit it must be an error. A SELECT query never returns a true, and only returns a false when there is an error.

SOF3 avatar Apr 21 '17 09:04 SOF3

How many times have I spelt @Muqsit wrongly as @musqit :P

SOF3 avatar Apr 21 '17 09:04 SOF3

@SOF3 True (that's what I meant). If this error can be produced in one task, it can be produced elsewhere too. For example, MySQLRenamePlayerTask - it has the same structuring and no fallback as to if the result returns false.

Muqsit avatar Apr 21 '17 11:04 Muqsit

A simple although not-too-graceful way to resolve this issue (but not your real issue) is to add a line ``if($result === false){ echo $db->error; $this->setResult(false); return; }`. It will not stop you from crashing, but it will at least display an error message for you.

SOF3 avatar Apr 21 '17 15:04 SOF3

Decision: Repeat every 20-30 seconds:

public function fixdb(){
            $sql = $this->db()->query("SELECT * FROM `table` LIMIT 1");
            $data = $sql->fetch_assoc();
            $sql->free();
        }

Thus stop waiting for the mysql server https://i.stack.imgur.com/UkZTG.gif

aquaminer avatar May 05 '17 05:05 aquaminer

Why not mysqli::ping()?

Not really relevant to this issue anyway?

SOF3 avatar May 05 '17 08:05 SOF3

@SOF3 This is her decision 😐. The solution is not one of the best, but I have not found another

aquaminer avatar May 05 '17 08:05 aquaminer

A little update. (This was my fault: I linked the plugin (.phar) files of the main server to a second server (both; the main and the second server were running at the same time). It was solved after copying the .phar files rather than linking them).

Warning: mysqli::query(): MySQL server has gone away in phar:////plugins/HereAuth_v1.0-Dev.phar/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask.php on line 39

Warning: mysqli::query(): Error reading result set's header in phar:////plugins/HereAuth_v1.0-Dev.phar/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask.php on line 39
[12:33:13] [Asynchronous Worker #2 thread/CRITICAL]: Error: "Call to a member function fetch_assoc() on boolean" (EXCEPTION) in "/plugins/HereAuth_v1.0-Dev.phar/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask" at line 40
[12:33:13] [Server thread/CRITICAL]: Could not execute asynchronous task MySQLLoadPlayerTask: Task crashed
[12:33:15] [Asynchronous Worker #2 thread/CRITICAL]: Error: "Call to a member function fetch_assoc() on boolean" (EXCEPTION) in "/plugins/HereAuth_v1.0-Dev.phar/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask" at line 40
[12:33:15] [Server thread/CRITICAL]: Could not execute asynchronous task MySQLLoadPlayerTask: Task crashed
[12:33:16] [Server thread/NOTICE]: Deleted 0 trash worlds.

Warning: mysqli::query(): MySQL server has gone away in phar:////plugins/HereAuth_v1.0-Dev.phar/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask.php on line 39

Warning: mysqli::query(): Error reading result set's header in phar:////plugins/HereAuth_v1.0-Dev.phar/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask.php on line 39
[12:34:20] [Asynchronous Worker #1 thread/CRITICAL]: Error: "Call to a member function fetch_assoc() on boolean" (EXCEPTION) in "/plugins/HereAuth_v1.0-Dev.phar/src/HereAuth/Database/MySQL/MySQLLoadPlayerTask" at line 40
[12:34:20] [Server thread/CRITICAL]: Could not execute asynchronous task MySQLLoadPlayerTask: Task crashed

za

Muqsit avatar May 12 '17 17:05 Muqsit

What, linking?

SOF3 avatar Jun 13 '17 03:06 SOF3

@SOF3 Yeah, linking (ln -s) one .phar file into every server's plugin folder.

Muqsit avatar Jun 13 '17 06:06 Muqsit

I suspect that you're actually using different versions of HereAuth.

SOF3 avatar Jun 13 '17 11:06 SOF3