Possible patch
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexProblems AFTER Install/Upgrade
Author Message
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3675
Location: Melbourne, AU

PostPost subject: Possible patch
Posted: Thu Jun 10, 2010 12:43 pm
Reply with quote

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
View user's profile Visit poster's website
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 952

PostPost subject: Re: Possible patch
Posted: Thu Jun 10, 2010 3:18 pm
Reply with quote

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
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3675
Location: Melbourne, AU

PostPost subject: Re: Possible patch
Posted: Mon Sep 27, 2010 4:30 am
Reply with quote

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
View user's profile Visit poster's website
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 952

PostPost subject: Re: Possible patch
Posted: Mon Sep 27, 2010 12:24 pm
Reply with quote

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
View user's profile Visit poster's website
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 952

PostPost subject: Re: Possible patch
Posted: Wed Sep 29, 2010 6:45 am
Reply with quote

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
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3675
Location: Melbourne, AU

PostPost subject: Re: Possible patch
Posted: Wed Sep 29, 2010 6:50 am
Reply with quote

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
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3675
Location: Melbourne, AU

PostPost subject: Re: Possible patch
Posted: Sat Oct 02, 2010 12:18 am
Reply with quote

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
View user's profile Visit poster's website
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 952

PostPost subject: Re: Possible patch
Posted: Sat Oct 02, 2010 7:52 am
Reply with quote

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 Smile

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
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3675
Location: Melbourne, AU

PostPost subject: Re: Possible patch
Posted: Sat Oct 02, 2010 10:39 am
Reply with quote

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
View user's profile Visit poster's website
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 952

PostPost subject: Re: Possible patch
Posted: Sun Oct 03, 2010 9:49 am
Reply with quote

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
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexProblems AFTER Install/Upgrade All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 1.6502 seconds with 19 DB Queries in 0.2075 seconds
Memory Usage: 2.96 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy