News:

Join the Facebook Fan Page.

Main Menu

Cannot delete topic (RC2)

Started by Simon9863, December 31, 2005, 06:43:50 PM

Previous topic - Next topic

Simon9863

Hi All,

Just upgraded to RC2 on a fedora 4 server, running php511 and mysql 5.018

I've always used the default mysql rpm packages and have never had problems, yet when trying to delete a topic, then i am getting this error

Database Error: Lost connection to MySQL server during query
File: pathto/forum/Sources/RemoveTopic.php
Line: 355Database Error: MySQL server has gone away
File: pathto/forum/Sources/Load.php
Line: 1886"

Also, when deleting a reply to a topic, then i get a blank screen, yet the reply is deleted...


I have no problems with any other function in the software, so wonder whether this is really an incorrect server configuration, as suggested in the help pages here etc.

I hyave no mods installed, and these are the official mysql rpm's not the redhat versions.

Can anyone possibly give me some idea's on this one please ?

Many thanks,
Regards
Simon

JayBachatero

Make sure that all files got overwriten. 
In your admin panel click on (more info) and it will tell you if your files are up to date.

-JayBachatero
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Simon9863

Hi there, every file is up to date and was overwritten before the upgrade, yet we're still having these problems, sadly :(


Hope the answer is out there somewhere :)

Thanks again,
Regards
Simon

JayBachatero

I will report this to a Dev so that he can take a closer look into this.

-JayBachatero
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Grudge

Simon,

That's a little odd - same message each time?

This query:

db_query("
DELETE FROM {$db_prefix}messages
WHERE ID_TOPIC $condition", __FILE__, __LINE__);


Seems to be causing it, but it's not a difficult one. How large is your forum? If you'd be so kind as to provide me with an admin account and phpMyAdmin access I may have a better change of debugging it.

Cheers,

Grudge
I'm only a half geek really...

Simon9863

Thanks, Grudge

I've sent you a PM with the relevent access details as per you request. Hope you can find the cause of this problem !


Many thanks :)
Regards
Simon

Grudge

#6
Simon,

I've fixed it, but I think this *may* actually be a bug with the MySQL you are running. I basically worked around it. It was actually an attachments query which was failing. Whenever using WHERE attachmentType = in the query, it lost connection to the server. I fixed it by changing these lines in RemoveTopic.php:

removeAttachments('a.attachmentType = '0' AND m.ID_TOPIC ' . $condition, 'messages');


To:

removeAttachments('a.attachmentType = \'0\' AND m.ID_TOPIC ' . $condition, 'messages');


However, that should NOT be needed, it's effectively casting the 0 as a string, although attachmentType is an integer - very, very odd.

Grudge

EDIT:  You need to make these changes to Post.php file.
Find a.attachmentType = 0
Replace a.attachmentType = \'0\'
I'm only a half geek really...

Simon9863

Thats great work Grudge !


Many, many thanks for finding this error.

These are official MySQL Rpm's as on MySQL's website, so should i report this as a mysql bug do you think ? If so, then how would i describe this to them ?


Many thanks again, i really was clueless on this one !

Regards
Simon

Grudge

#8
The query that failed was this:

SELECT
a.filename, a.attachmentType, a.ID_ATTACH, a.ID_MEMBER, a.ID_MSG,
IFNULL(thumb.ID_ATTACH, 0) AS ID_THUMB, thumb.filename AS thumb_filename, thumb_parent.ID_ATTACH AS ID_PARENT
FROM (cvssmf_attachments AS a)
LEFT JOIN cvssmf_attachments AS thumb ON (thumb.ID_ATTACH = a.ID_THUMB)
LEFT JOIN cvssmf_attachments AS thumb_parent ON (a.attachmentType = 3 AND thumb_parent.ID_THUMB = a.ID_ATTACH)
WHERE a.attachmentType = 0
AND a.ID_MSG = 2230

So could ask them why. I'll upgrade my MySQL install a sec and see if it breaks for me...

Update: Upgraded MySQL to 5.0.18-nt and worked fine :/
I'm only a half geek really...

Simon9863

Hmmm, i used the generic Linux x86 RPM's, as i don't run Windows on my server.


I wonder if anyone else has had a problem with these RPM's, apart from me ?


korruption

I had the same problem, I made the change that Grudge suggested to the RemoveTopic.php that fixed it. Then after trying to modify a post I ran into the same problem with the Post.php file.
So I disabled attachments on the board and all the problems went away.

I am running PHP 5.1.1, MySQL 5.0.18 and Apache 2.2.0 on Debian 3.1.
PHP and Apache were installed from source MySQL is latest bin dist.

I dont know if the prob is with MySQL 5 or what as I havent had a chance to test it with 4.1.

tiko

#11
Hello,

Digging up an old topic here, but I'm having the same problem as apparently many others are having.  I'm receiving the same error, but additionally the error is causing my mysql server to restart itself, as well as some other quirks that cause the post count to be completely inaccurate.  Also, any other posts in the category are hidden (seemingly removed) until I recount forum totals/stats from within the admin panel.

My configuration is:
FreeBSD 6.0
Apache 2.0.55
PHP 4.4.2
MySQL 5.0.19, built with FreeBSD ports

I have not applied Grudge's fix yet, but was curious if any progress has been made to track down this problem.

Thanks.

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

JuhaS14

I have tried with 5.0.19 and 5.0.18 Mysql and get same error in Debian.

JuhaS14

Same kind of problem when i try to remove post (not topic), it deleted post but gives me error message:

Tietokantavirhe: MySQL server has gone away
Tiedosto: /var/www/forum/Sources/Subs.php
Rivi: 419Tietokantavirhe: MySQL server has gone away
Tiedosto: /var/www/forum/Sources/Load.php
Rivi: 1886

JayBachatero

Can you please port a copu of your Load.php?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert


JayBachatero

Sorry wrong file.  It's RemoveTopic.php
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert


Kuzmitch

I have probably the same problems with the configuration. Please look at this topic: http://www.simplemachines.org/community/index.php?topic=79005.0

This fix (removeAttachments('a.attachmentType = \'0\' AND m.ID_TOPIC ' . $condition, 'messages');) was applied already.

Thankx!

Advertisement: