FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Messed up my private message file...
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Messed up my private message file... [message #13973] Sun, 02 November 2003 18:56 Go to next message
dai03 is currently offline  dai03   United States
Messages: 7
Registered: November 2003
Karma: 0
Junior Member
I have my private message file and database all out of sync...

Would it be safe to delete everything from the fud21_pmsg table and set the private file back to 0 length to get it working again? Or will it break something else?

I tried running the consistancy checker and it didn't seem to fix anything and as it is now all private messages show up as having no text even though I see the text in the private file.

Thanks!!

[Updated on: Mon, 03 November 2003 02:03]

Report message to a moderator

Re: Messed up my private message file... [message #13974 is a reply to message #13973] Sun, 02 November 2003 19:01 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
If you remove all data from the fud_pmsg table that'll allow you to start from scratch as far as private messages are concerned. Do you know what caused the 2 to get out of sync originally?

FUDforum Core Developer
Re: Messed up my private message file... [message #13975 is a reply to message #13974] Sun, 02 November 2003 19:18 Go to previous messageGo to next message
dai03 is currently offline  dai03   United States
Messages: 7
Registered: November 2003
Karma: 0
Junior Member
I just moved to some new servers and I thought I had shut down all servers and copied all the files and the database over to the new machines, but I guess I must have had a straggler somewhere.

The main message board is fine, just the private messages.

When people send new private messages the body is always blank even though I see the body information appearing in the private text file.

I zeroed out the private text file earlier (without killing the data in the database) and was able to post a private message and it worked until I then deleted some old private messages that weren't there anymore.

Does Fud delete from the private message file when people delete messages from their trash folder??

Thanks for the help!!
Re: Messed up my private message file... [message #13976 is a reply to message #13975] Sun, 02 November 2003 19:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
When people delete messages the data file is not modified. It is only modified if you run the compactor script. The error you describe could be result of incorrect permissions. I suspect when you moved the server the private file was created in such a way that the webserver could not read/write to it.

FUDforum Core Developer
Re: Messed up my private message file... [message #13978 is a reply to message #13976] Sun, 02 November 2003 19:30 Go to previous messageGo to next message
dai03 is currently offline  dai03   United States
Messages: 7
Registered: November 2003
Karma: 0
Junior Member
That was my first guess, but the file IS getting written to.

I can see the new data in the file when people post new messages. The the messages still show up as no text. The permissions and everything is exactly the same as the msg_1 file:

-rw------- 1 nobody nobody 34377153 Nov 2 13:26 msg_1
-rw------- 1 nobody nobody 675 Nov 2 12:48 private

It't the strangest thing. That's why I though I would ask.

I still have the original private file as well. I might try putting it back and trying some stuff if you have any ideas!??

Thanks again for the help!!
Re: Messed up my private message file... [message #13980 is a reply to message #13978] Sun, 02 November 2003 19:33 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Create a new private message, once that is done, go to your MySQL and get the info on the last entry inside the pmsg table. Specifically look @ the offset and length fields.

FUDforum Core Developer
Re: Messed up my private message file... [message #13981 is a reply to message #13980] Sun, 02 November 2003 19:38 Go to previous messageGo to next message
dai03 is currently offline  dai03   United States
Messages: 7
Registered: November 2003
Karma: 0
Junior Member
It's weird, the ofset is correct, but the length is being set as 0!

| 12720 | DAI '03; | 1 | 1 | 0 | 216.98.166.146 | NULL | 1067801700 | 1067801711 | No-Msg.gif | Y | INBOX | Test again | 0 | Y | N | N | 675 | 0 | N | NULL |

BTW:
Even though ther is a No-Msg.gif icon, there was some text entered into the message body! Smile

[Updated on: Sun, 02 November 2003 19:45]

Report message to a moderator

Re: Messed up my private message file... [message #13983 is a reply to message #13981] Sun, 02 November 2003 19:48 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
That would be the cause of the problem....
I suspect your forum is affected by a bug in the old private message writing code that is triggered on some PHP versions.

If you can paste me the private message writing code from your forum (private.inc.t), I could suggest an alternative.


FUDforum Core Developer
Re: Messed up my private message file... [message #13984 is a reply to message #13983] Sun, 02 November 2003 19:52 Go to previous messageGo to next message
dai03 is currently offline  dai03   United States
Messages: 7
Registered: November 2003
Karma: 0
Junior Member
Yep, the new server has all the latest versions of PHP. I had it break another script having to do with file transfers.

Here is a copy of my private.inc.t
---------------------------------------------

(I deleted the code... Sorry about that!!)

[Updated on: Mon, 03 November 2003 01:35]

Report message to a moderator

icon14.gif  I'm fixing to have to travel away from the computer for a while... [message #13985 is a reply to message #13983] Sun, 02 November 2003 20:03 Go to previous messageGo to next message
dai03 is currently offline  dai03   United States
Messages: 7
Registered: November 2003
Karma: 0
Junior Member
Got to do a couple of stops on the way home, so if you may not hear back from me for a while.

Thanks again for all the help!!!
Re: I'm fixing to have to travel away from the computer for a while... [message #13987 is a reply to message #13985] Sun, 02 November 2003 20:24 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
1) In the future please do not paste files into messages, attach them instead it makes my life much easier.

As for the fix try the following, replace this:
<?php
unction write_pmsg_body
($text)
{
$fp = fopen($GLOBALS['MSG_STORE_DIR'].'private', 'ab');

if( !(
$s = ftell($fp)) ) $s = __ffilesize($fp);

fwrite($fp, $text);
fflush($fp);
$len = (ftell($fp)-$s);
fclose($fp);

if( !
$s ) chmod($GLOBALS['MSG_STORE_DIR'].'private', 0600);

return array(
$s,$len);
}
?>


with

<?php
$fp
= fopen($GLOBALS['MSG_STORE_DIR'].'private', 'ab');

        
fseek($fp, 0, SEEK_END);
        if (!(
$s = ftell($fp))) {
                
$s = __ffilesize($fp);
        }

        if ((
$len = fwrite($fp, $text)) !== strlen($text)) {
                exit(
"FATAL ERROR: system has ran out of disk space
\n"
);
        }
        
fclose($fp);

return array(
$s, $len);
?>


However, I'd strongly recommend upgrading your FUDforum version.


FUDforum Core Developer
icon14.gif  Re: I'm fixing to have to travel away from the computer for a while... [message #13990 is a reply to message #13987] Mon, 03 November 2003 02:03 Go to previous messageGo to next message
dai03 is currently offline  dai03   United States
Messages: 7
Registered: November 2003
Karma: 0
Junior Member
Thanks!!! Works like a charm now!!

I would upgrade, but I'm using a custom version of Fud you wrote for me a year or so ago.

If there is anything major that you think might need to be updated, let me know and we'll work out what it would cost for you to do some patching, otherwise it is working great!!!

Thanks again for the help!!!
Re: I'm fixing to have to travel away from the computer for a while... [message #13995 is a reply to message #13990] Mon, 03 November 2003 13:57 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, if it works fine and you have no problems then stay with what you go. If you experience various issues, then there maybe a need to upgrade some portions of the code.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Multiple FUDforum fron single install
Next Topic: Member account activity question
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 08 22:49:37 GMT 2024

Total time taken to generate the page: 0.03782 seconds