MySQL server has gone away [2006] - Extension Manager Plus
Re: MySQL server has gone away [2006]
Thanks for the detailed analysis!
I re-ran the extension check and now the warnings are only shown where there are actual problems with the check.
I actually have a lot of old extensions that don't have version checking available anymore.
Is this a phpBB issue or is this normal behavior when there are a lot of "problem" extensions? Should this be reported to the phpBB bug tracker?
I re-ran the extension check and now the warnings are only shown where there are actual problems with the check.
I actually have a lot of old extensions that don't have version checking available anymore.
Is this a phpBB issue or is this normal behavior when there are a lot of "problem" extensions? Should this be reported to the phpBB bug tracker?
-
- Registered User
- Posts: 61
- Joined: Sat Aug 25, 2007 4:55 pm
- Location: Tallinn, Estonia
- Name: Dmitry
Re: MySQL server has gone away [2006]
Tracker would be useful, because this is clearly a phpBB problem, since the phpBB version check cannot be fully executed if a PHP or SQL timeout occurs during this. EMP 2.0.2 is no longer affected by this problem, because my workaround now simply executes all actions that are normally executed immediately after a version check only the next time the page is loaded. EMP has a ToDo function that I have now used for this workaround.
But before you report this in the tracker:
For those extensions for which EMP shows the yellow warning triangle, you should use "Details" to check whether this ext has a functioning version check. If so, you should create a list with the names of these exts. Then you should deactivate EMP and perform a version check. If the versions of your noted exts are then displayed in black instead of red or green, then this is a clear sign that phpBB could not determine the version and proof that the problem lies with phpBB.
But before you report this in the tracker:
For those extensions for which EMP shows the yellow warning triangle, you should use "Details" to check whether this ext has a functioning version check. If so, you should create a list with the names of these exts. Then you should deactivate EMP and perform a version check. If the versions of your noted exts are then displayed in black instead of red or green, then this is a clear sign that phpBB could not determine the version and proof that the problem lies with phpBB.
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany
Re: MySQL server has gone away [2006]
I added an edit to the post before your answer, this may have overlapped with your answer, did you see the edit?dimassamid wrote:Thanks for the detailed analysis!
https://www.phpbb.com/customise/db/exte ... 43#p884443
I just noticed that I obviously misunderstood you. Hence a new answer:I actually have a lot of old extensions that don't have version checking available anymore.
Is this a phpBB issue or is this normal behavior when there are a lot of "problem" extensions? Should this be reported to the phpBB bug tracker?
If the version check no longer works for old extensions, then this is generally the responsibility of the extension developers, but not the responsibility of phpBB itself. There is one exception, however: if the version check no longer works for an extension that comes from the CDB, then there may be an HTTP/HTTPS problem and that is actually a problem in the phpBB environment itself. See:
https://tracker.phpbb.com/browse/WEBSITE-1434
https://tracker.phpbb.com/browse/PHPBB-17385
https://github.com/phpbb/phpbb/pull/6708
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany
Re: MySQL server has gone away [2006]
I looked at your post with your host's answer again:
Search for:
Add below:
Then call up the ExtMgr in the ACP. A debug text should now be visible at the top of the page. Copy it and post it here.
I may be able to get around the SQL timeout problem at least in EMP so that phpBB can fully perform the version check. But before I can build in a workaround for this, I need some information from you. In the specific version I gave you, please make the following change:dimassamid wrote: This value is global and cannot be changed. They recommend increasing thewait_timeout
for the session using the site code.
SET SESSION wait_timeout = 600
Search for:
Code: Select all
add_form_key('lukewcs_extmgrplus');
Code: Select all
$sql = "SHOW SESSION VARIABLES
WHERE Variable_name = 'wait_timeout'";
$result = $this->db->sql_query($sql);
$sql_wait_timeout = $this->db->sql_fetchfield('Value');
$this->db->sql_freeresult($result);
var_dump($sql_wait_timeout);
var_dump(ini_get('max_execution_time'));
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany
Re: MySQL server has gone away [2006]
Thanks for creating a bug report on the tracker, as it's a bit difficult for me (as a user) to create such cases, as I am not competent enough to describe the problem. But I think phpBB should reconsider their approach to version checking.
There are some that cannot be checked due to an outdated URL. But there are also those that cannot be checked due to a timeout, but if I click "Details", the check is successful.
This is what I see at the top of the extensions page:
This is what I see after checking the version. White page with the following error
I have both of these.LukeWCS wrote:If the version check no longer works for old extensions, then this is generally the responsibility of the extension developers, but not the responsibility of phpBB itself. There is one exception, however: if the version check no longer works for an extension that comes from the CDB, then there may be an HTTP/HTTPS problem and that is actually a problem in the phpBB environment itself.
There are some that cannot be checked due to an outdated URL. But there are also those that cannot be checked due to a timeout, but if I click "Details", the check is successful.
I made these changes.LukeWCS wrote:I need some information from you. In the specific version I gave you, please make the following change:
This is what I see at the top of the extensions page:
Code: Select all
string(2) "30" string(3) "600" [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 139: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/lukewcs/extmgrplus/core/ext_mgr_plus.php:154)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 139: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/lukewcs/extmgrplus/core/ext_mgr_plus.php:154)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 139: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/lukewcs/extmgrplus/core/ext_mgr_plus.php:154)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 139: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/lukewcs/extmgrplus/core/ext_mgr_plus.php:154)
Code: Select all
string(2) "30" string(3) "600" [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1813: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/lukewcs/extmgrplus/core/ext_mgr_plus.php:154)
-
- Registered User
- Posts: 61
- Joined: Sat Aug 25, 2007 4:55 pm
- Location: Tallinn, Estonia
- Name: Dmitry
Re: MySQL server has gone away [2006]
Yes, those are exactly the extensions that have the phpBB-SQL-timeout-problem and that's exactly what I'm trying to fix with a workaround.dimassamid wrote: But there are also those that cannot be checked due to a timeout, but if I click "Details", the check is successful.
Great, that's all I needed, then the workaround might actually work. Test this new version:dimassamid wrote:This is what I see at the top of the extensions page:
edit: Attachment removed because it does not work as hoped.
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany
Re: MySQL server has gone away [2006]
Extension versions are checked, but I still see a yellow warning triangle next to the green/red version number. The triangle disappears if I click "Details".
-
- Registered User
- Posts: 61
- Joined: Sat Aug 25, 2007 4:55 pm
- Location: Tallinn, Estonia
- Name: Dmitry
Re: MySQL server has gone away [2006]
Darn it! Okay, I implemented your hoster's suggestion, but unfortunately it doesn't work. So I have no other options now. The problem is with phpBB, not EMP. Unfortunately, the version check checks all extensions at once, instead of doing it in blocks. And it is precisely this behavior that leads to the SQL timeout.
With the first workaround, EMP can now at least save the versions of all successfully checked extensions in the DB. And you have to check the rest manually using "Details" so that EMP can also save this data. Not ideal, but better than nothing.
With the first workaround, EMP can now at least save the versions of all successfully checked extensions in the DB. And you have to check the rest manually using "Details" so that EMP can also save this data. Not ideal, but better than nothing.
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany
Re: MySQL server has gone away [2006]
Anyway, thanks for the edits you made. It already solved the main problem described in this topic. 
-
- Registered User
- Posts: 61
- Joined: Sat Aug 25, 2007 4:55 pm
- Location: Tallinn, Estonia
- Name: Dmitry
Re: MySQL server has gone away [2006]
It was worth a try.dimassamid wrote:Anyway, thanks for the edits you made.

However, that was just a workaround so that EMP at least wouldn't be blocked by the SQL timeout, not a solution. When it became clear that your hoster's suggestion wouldn't work, I came up with a theoretical concept of how to solve it. In the last few evenings I started to create the necessary auxiliary functions and this evening I was able to do a first test run. I think when I show two screens it will become clear what I'm building.

1. 2.
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany
Re: MySQL server has gone away [2006]
Wow. Splitting the process into multiple parts, like with creating search indexes. That looks cool. 

-
- Registered User
- Posts: 61
- Joined: Sat Aug 25, 2007 4:55 pm
- Location: Tallinn, Estonia
- Name: Dmitry
Re: MySQL server has gone away [2006]
Yep. The technology used is old, but proven. ^^
I need some more information from you. You wrote that you have 140 extensions. And how many of them have a version check?
I need some more information from you. You wrote that you have 140 extensions. And how many of them have a version check?
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany
Re: MySQL server has gone away [2006]
96 of them with version check.
-
- Registered User
- Posts: 61
- Joined: Sat Aug 25, 2007 4:55 pm
- Location: Tallinn, Estonia
- Name: Dmitry
Re: MySQL server has gone away [2006]
Okay, then we now have all the data we need to do a bit of theorizing and calculations.
This is of course not a precise calculation but just a rough estimate based on the average. How long the version check actually takes and how many versions can actually be determined depends primarily on the following factors:
With this change, 2.1.0 can flexibly adapt to the actual conditions/circumstances. Since 30 seconds is often the standard PHP limit on the Internet (at least according to my observations), I use 15 seconds as a "safe value". Also because phpBB itself uses 50% as a safe value in certain places. This means that under ideal conditions more extensions can be determined per run (more flexible) and under poor conditions phpBB/EMP would have enough reserves (more secure) for the version check to still be completed successfully.
- Extensions with VC: 96
- Duration of the version check for you: around 45 seconds
- SQL limit: 30 seconds <- This is the bottleneck that blocks phpBB and EMP
- PHP limit: 600 seconds <- We definitely don't have to worry about this value
This is of course not a precise calculation but just a rough estimate based on the average. How long the version check actually takes and how many versions can actually be determined depends primarily on the following factors:
- How good the connection is between the phpBB server (where your phpBB is installed) and the respective version server (where the version file is retrieved).
- How busy the phpBB server is.
- How busy the respective version server is.
With this change, 2.1.0 can flexibly adapt to the actual conditions/circumstances. Since 30 seconds is often the standard PHP limit on the Internet (at least according to my observations), I use 15 seconds as a "safe value". Also because phpBB itself uses 50% as a safe value in certain places. This means that under ideal conditions more extensions can be determined per run (more flexible) and under poor conditions phpBB/EMP would have enough reserves (more secure) for the version check to still be completed successfully.
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany
Re: MySQL server has gone away [2006]
@dimassamid
I have now published branch 2.1.0 in the GitHub repository, the current version is 2.1.0-b2. Please test it and give me feedback.
This must be treated like a regular update, so deactivate EMP and delete it via FTP and replace it completely with 2.1.0, then activate it again.
https://github.com/LukeWCS/ext-mgr-plus/tree/2.1.0
I have now published branch 2.1.0 in the GitHub repository, the current version is 2.1.0-b2. Please test it and give me feedback.
This must be treated like a regular update, so deactivate EMP and delete it via FTP and replace it completely with 2.1.0, then activate it again.
https://github.com/LukeWCS/ext-mgr-plus/tree/2.1.0
May the backup be with you. Always.
-
- Registered User
- Posts: 309
- Joined: Mon Dec 08, 2014 12:32 pm
- Location: Germany