| Author |
Message |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3675 Location: Melbourne, AU
|
Post subject: Possible patch Posted: Thu Jun 10, 2010 12:43 pm |
|
The following patch should fix at least one if not all of the following issues that you may have experiencing.
- MySQL gone away error (may not be related since the proper fix should be "auto reconnect")
- MySQL duplicate key error for security table
Compatibility: all DragonflyCMS.
Depending your DragonflyCMS version the line number where the patch should be applied will change, so you may need to search a little.
Open includes/cmsinit.inc and find, around line 140, something similar to:
PHP:
require_once(CORE_PATH.'classes/time.php'); if (!defined('XMLFEED')) { require_once(CORE_PATH.'functions/display.php'); require_once(CORE_PATH.'classes/cpg_member.php'); require_once(CORE_PATH.'classes/multibyte.php'); require_once(CORE_PATH.'classes/session.php'); require_once(CORE_PATH.'classes/template.php'); }
After add:
PHP:
function df_shutdown() { global $SESS, $db; if (is_object($SESS)) { $SESS->write_close; } if (is_object($db)) { $db->sql_close(); } } register_shutdown_function('df_shutdown');
Apply this patch only if you are experiencing one of the listed issues and please don't forget to post your positive or negative feedback.
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
layingback


Joined: Apr 19, 2004 Posts: 952
|
Post subject: Re: Possible patch Posted: Thu Jun 10, 2010 3:18 pm |
|
Thanks Nano. Installed to 6 sites, 2 of which trigger MySQL gone away every month or 2, and 1 of which occasionally encounters duplicate security key. Will report any re-occurrence. (Unfortunately the site which encountered dup keys on a regular basis is no longer in service - for unrelated reasons.)
_________________ Pro_News: The complete module for Dragonfly - now available as version 3.3
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) 2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1 |
|
| Back to top |
|
 |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3675 Location: Melbourne, AU
|
Post subject: Re: Possible patch Posted: Mon Sep 27, 2010 4:30 am |
|
Any good from this patch?
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
layingback


Joined: Apr 19, 2004 Posts: 952
|
Post subject: Re: Possible patch Posted: Mon Sep 27, 2010 12:24 pm |
|
I've had 1 MySQL gone away - but may well be unrelated cause (shared MySQL on shared server) - hard to tell with just 1 case.
No duplicate key errors.
Both are across all sites.
So I would want to keep these fixes!
_________________ Pro_News: The complete module for Dragonfly - now available as version 3.3
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) 2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1 |
|
| Back to top |
|
 |
layingback


Joined: Apr 19, 2004 Posts: 952
|
Post subject: Re: Possible patch Posted: Wed Sep 29, 2010 6:45 am |
|
Ahh, got another MySQL server has gone away overnight. On Storez block, so nothing to do with any of my code.
So it may have reduced occurrence of MySQL but not cured it - as you expected I think.
_________________ Pro_News: The complete module for Dragonfly - now available as version 3.3
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) 2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1 |
|
| Back to top |
|
 |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3675 Location: Melbourne, AU
|
Post subject: Re: Possible patch Posted: Wed Sep 29, 2010 6:50 am |
|
Yep, as per my first post the proper fix for the "gone away" error is to enable the auto reconnect.
But I suspect that should at least fix the duplicate key error, I just need to be sure and only testing can give me that answer.
Thanks for the feedback!
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3675 Location: Melbourne, AU
|
Post subject: Re: Possible patch Posted: Sat Oct 02, 2010 12:18 am |
|
By the way it may happen for many other reason, what you can do is check the uptime of the server against the error time, you may found out that MySQL server was killed and restarted.
A backup may cause this because it will lock the tables and no read or write will be allowed and generally will make things slower thus exceeding different timeouts. If you have any ongoing backups check if the error time coincide with the the backup time.
These are some of the many possible cause, I'm just trying to explore few ... I want to get this sorted out once and forever.
Also in past the IP address sent with the email was 0.0.0.0 and depending of the DragonflyCMS version used should be also fixed.
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
layingback


Joined: Apr 19, 2004 Posts: 952
|
Post subject: Re: Possible patch Posted: Sat Oct 02, 2010 7:52 am |
|
NanoCaiordo wrote:
By the way it may happen for many other reason, what you can do is check the uptime of the server against the error time, you may found out that MySQL server was killed and restarted.
'Fraid not. The sites with the issue all run in an Ensim/Parallels Pro host set the High Security. There is very, very little that I can do with MySQL in such a site. The security and lock down on this host is very high. Makes for stable running environment though 
Am scheduled to move to cPanel but do not know yet if I'm in the pre-Xmas or post-Jan batch... Plus I'll be on a much faster server, so issue may be moot then if iot is timeout related.
Is there a MySQL call that I can make in phpMyAdmin to look this info up? (For next time.)
_________________ Pro_News: The complete module for Dragonfly - now available as version 3.3
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) 2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1 |
|
| Back to top |
|
 |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3675 Location: Melbourne, AU
|
Post subject: Re: Possible patch Posted: Sat Oct 02, 2010 10:39 am |
|
Just run "mysqladmin version" and check the uptime ... if it coincide with the email then it was a server issue and not related to DragonflyCMS.
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
layingback


Joined: Apr 19, 2004 Posts: 952
|
Post subject: Re: Possible patch Posted: Sun Oct 03, 2010 9:49 am |
|
Thanks, but sever got reset this morning due to a load spike (backup process)! So all history lost.
For the record, and benefit of others, it is possible to see the MySQL server uptime and start time in phpMyAdmin.
Before selecting a database (ie. at the localhost level), click on 'Show MySQL runtime information'. Info shown at top of page.
_________________ Pro_News: The complete module for Dragonfly - now available as version 3.3
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) 2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1 |
|
| Back to top |
|
 |