Advertisement:

Author Topic: Cannot delete topic (RC2)  (Read 23361 times)

Offline Simon9863

  • Semi-Newbie
  • *
  • Posts: 12
Cannot delete topic (RC2)
« on: December 31, 2005, 06:43:50 PM »
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
« Last Edit: March 31, 2006, 08:28:40 AM by redone »

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Cannot delete topic (RC2)
« Reply #1 on: December 31, 2005, 06:46:49 PM »
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

Offline Simon9863

  • Semi-Newbie
  • *
  • Posts: 12
Re: Cannot delete topic (RC2)
« Reply #2 on: December 31, 2005, 09:21:35 PM »
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

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Cannot delete topic (RC2)
« Reply #3 on: December 31, 2005, 09:30:30 PM »
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

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Cannot delete topic (RC2)
« Reply #4 on: January 01, 2006, 04:43:34 AM »
Simon,

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

This query:
Code: [Select]
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...

Offline Simon9863

  • Semi-Newbie
  • *
  • Posts: 12
Re: Cannot delete topic (RC2)
« Reply #5 on: January 01, 2006, 12:09:36 PM »
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

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Cannot delete topic (RC2)
« Reply #6 on: January 01, 2006, 01:28:17 PM »
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:
Code: [Select]
removeAttachments('a.attachmentType = '0' AND m.ID_TOPIC ' . $condition, 'messages');

To:
Code: [Select]
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\'
« Last Edit: May 05, 2006, 07:05:14 PM by JayBachatero »
I'm only a half geek really...

Offline Simon9863

  • Semi-Newbie
  • *
  • Posts: 12
Re: Cannot delete topic (RC2)
« Reply #7 on: January 01, 2006, 01:33:18 PM »
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

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Cannot delete topic (RC2)
« Reply #8 on: January 01, 2006, 01:45:59 PM »
The query that failed was this:
Code: [Select]
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 :/
« Last Edit: January 01, 2006, 03:21:23 PM by Grudge »
I'm only a half geek really...

Offline Simon9863

  • Semi-Newbie
  • *
  • Posts: 12
Re: Cannot delete topic (RC2)
« Reply #9 on: January 01, 2006, 06:51:19 PM »
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 ?


Offline korruption

  • Newbie
  • *
  • Posts: 1
Re: Cannot delete topic (RC2)
« Reply #10 on: January 09, 2006, 04:38:47 PM »
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.

Offline tiko

  • Newbie
  • *
  • Posts: 7
Re: Cannot delete topic (RC2)
« Reply #11 on: March 19, 2006, 12:10:35 PM »
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.
« Last Edit: March 19, 2006, 12:12:41 PM by tiko »

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Cannot delete topic (RC2)
« Reply #12 on: March 19, 2006, 12:26:36 PM »
Try applying Grudge's fix.
Follow me on Twitter

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

Offline JuhaS14

  • Jr. Member
  • **
  • Posts: 228
  • Gender: Male
    • Free Joomla templates
Re: Cannot delete topic (RC2)
« Reply #13 on: March 21, 2006, 01:59:54 PM »
I have tried with 5.0.19 and 5.0.18 Mysql and get same error in Debian.

Offline JuhaS14

  • Jr. Member
  • **
  • Posts: 228
  • Gender: Male
    • Free Joomla templates
Re: Cannot delete topic (RC2)
« Reply #14 on: March 21, 2006, 02:07:08 PM »
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

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Cannot delete topic (RC2)
« Reply #15 on: March 25, 2006, 12:49:13 AM »
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

Offline JuhaS14

  • Jr. Member
  • **
  • Posts: 228
  • Gender: Male
    • Free Joomla templates
Re: Cannot delete topic (RC2)
« Reply #16 on: March 26, 2006, 12:25:21 PM »

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Cannot delete topic (RC2)
« Reply #17 on: March 26, 2006, 12:40:39 PM »
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

Offline JuhaS14

  • Jr. Member
  • **
  • Posts: 228
  • Gender: Male
    • Free Joomla templates
Re: Cannot delete topic (RC2)
« Reply #18 on: March 31, 2006, 03:17:08 AM »

Offline Kuzmitch

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
    • GuitarPlayer.Ru
Re: Cannot delete topic (RC2)
« Reply #19 on: March 31, 2006, 03:52:13 AM »
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!