Clan x86

Announcements => [x86] Announcements => Topic started by: iago on July 24, 2007, 09:14:08 am

Title: Forum Errors
Post by: iago on July 24, 2007, 09:14:08 am
So sometime last night, the forum crapped itself. I have no idea why, but the Settings.php file and Settings_bak.php files ended up empty. Don't ask me why the backup file is broken at the same time as the main one, there are some things that Man was not meant to know.

In any case, I did a fresh install of SMF and copied the settings file back, modified the DB stuff and, after I reset the DB password (how was I supposed to remember what it was? :) ), it seems almost perfect.

The only problem was that some of the categories moved a little. So I fixed that. So far I haven't noticed any other problems, but let me know if you do.

The DB seems to be unaffected, so that's a plus. The latest backup I have is yesterday morning so I didn't really want to roll it back.

If you see any problems, post it here and me (or one of the other leaders) will take care of it as quickly as possible!
Title: Re: Forum Errors
Post by: chuck on July 24, 2007, 12:31:22 pm
Just out of curiosity, are you monitoring the server after this for suspicious activity? I doubt its that, its probably just php crashing when someone was setting the settings, but better safe than sorry...
Title: Re: Forum Errors
Post by: iago on July 24, 2007, 12:43:15 pm
I used to, for educational reasons. Now I just back it up every day and pray :P

I don't think it was anything malicious, though, although I did do most of the forensic work at 6:30 this morning :)
Title: Re: Forum Errors
Post by: Sidoh on July 24, 2007, 01:32:03 pm
Just out of curiosity, are you monitoring the server after this for suspicious activity? I doubt its that, its probably just php crashing when someone was setting the settings, but better safe than sorry...

Setting the settings, what?  I don't think SMF attempts to modify its Setting files outside of the installation process. :S
Title: Re: Forum Errors
Post by: iago on July 24, 2007, 02:15:05 pm
If that were true, why did that file end up empty? 

I really don't know what happened, but whatever. Hopefully it won't happen again :)
Title: Re: Forum Errors
Post by: Sidoh on July 24, 2007, 02:24:24 pm
If that were true, why did that file end up empty? 

I really don't know what happened, but whatever. Hopefully it won't happen again :)

I don't know, but I'm pretty sure the only times that Settings.php is modified is during the installation process and when you change something in the administration panel.  It went down at around 1:30 AM MST.  I know I wasn't doing anything then.  Can the other admins say the same?

I'm not saying chuck's hypothesis is conclusively incorrect.  I just don't think Settings.php is modified except in special situations.
Title: Re: Forum Errors
Post by: iago on July 24, 2007, 02:29:40 pm
The only related incident I can think of is that the harddrive on the server was almost completely full. This is a result of my negligence, since I do a nightly backup and hadn't bothered deleting old ones in awhile.

But I don't see how that could affect it.
Title: Re: Forum Errors
Post by: chuck on July 24, 2007, 02:32:30 pm
If that were true, why did that file end up empty? 

I really don't know what happened, but whatever. Hopefully it won't happen again :)

I don't know, but I'm pretty sure the only times that Settings.php is modified is during the installation process and when you change something in the administration panel.  It went down at around 1:30 AM MST.  I know I wasn't doing anything then.  Can the other admins say the same?

I'm not saying chuck's hypothesis is conclusively incorrect.  I just don't think Settings.php is modified except in special situations.
Its just a guess, I sometimes fiddle with scripts and find every way I can to break them. I've found when some scripts are terminated while writing to files, strange things happen. I'm not saying this happened, its just a possibility.

The only related incident I can think of is that the harddrive on the server was almost completely full. This is a result of my negligence, since I do a nightly backup and hadn't bothered deleting old ones in awhile.

But I don't see how that could affect it.
Linux sometimes does strange things to me when the hard-drive is near full. I've opened a web browser and got garbage all over the screen, and ctrl+alt+f1'ed and saw errors spitting out on the console about a full disk.
Title: Re: Forum Errors
Post by: Sidoh on July 24, 2007, 02:34:08 pm
Its just a guess, I sometimes fiddle with scripts and find every way I can to break them. I've found when some scripts are terminated while writing to files, strange things happen. I'm not saying this happened, its just a possibility.

It's definitely a possibility.  I don't disagree at all there. :)
Title: Re: Forum Errors
Post by: Newby on July 30, 2007, 11:14:48 am
It appears the move dicked with the forum timezone. If you're having issues with your timestamps on posts, go to your Profile (click the button on the menu), go to Look and Layout Preferences, and have it auto-detect the offset. I just tested it, and that fixed it. :)
Title: Re: Forum Errors
Post by: Towelie on July 30, 2007, 11:17:33 am
It appears the move dicked with the forum timezone. If you're having issues with your timestamps on posts, go to your Profile (click the button on the menu), go to Look and Layout Preferences, and have it auto-detect the offset. I just tested it, and that fixed it. :)
its off by 10 mins for me now :P
Title: Re: Forum Errors
Post by: iago on July 30, 2007, 05:34:37 pm
I have no idea why the clock was so far off on that server, it was likely due to testing stuff. I fixed it now, though, so change your timezone back to where it ought to be :)
Title: Re: Forum Errors
Post by: CrAz3D on July 30, 2007, 05:39:23 pm
hmm, so is it still at your house?
Title: Re: Forum Errors
Post by: chuck on July 30, 2007, 05:44:46 pm
You should install ntpdate, and make it sync the clock every few hours.

And you killed my avatar! *Goes hunting for it on his harddrive*

EDIT:
Ahh, this makes sense now.

Code: [Select]
An Error Has Occurred!
The attachments upload directory is not writable. Your attachment or avatar cannot be saved.
Title: Re: Forum Errors
Post by: iago on July 30, 2007, 06:04:47 pm
hmm, so is it still at your house?
Yes, until somebody provides better hosting it's going to live there. I just merged the two Web servers, which I didn't really want to do but was kinda forced into it.

You should install ntpdate, and make it sync the clock every few hours.

And you killed my avatar! *Goes hunting for it on his harddrive*

EDIT:
Ahh, this makes sense now.

Code: [Select]
An Error Has Occurred!
The attachments upload directory is not writable. Your attachment or avatar cannot be saved.
I use ntpdate, it's set to run every night. To update the time to the proper one, I just ran it manually (/etc/cron.daily/updatetime.sh) and it worked fine, so I don't know what happened there.

I thought I made the folders writable by the Web user, but maybe I screwed up. Try again?

<edit> Better yet, why don't I fix the path to the one where the files actually are? Avatars fixed! :D
Title: Re: Forum Errors
Post by: deadly7 on July 30, 2007, 07:14:08 pm
Time is off for me even though iago and I are in the same time zone. >>
Title: Re: Forum Errors
Post by: iago on July 30, 2007, 07:33:28 pm
Time is off for me even though iago and I are in the same time zone. >>
Actually, no, I'm in MST. But the server is in CST and the time is correct on it. Not sure why your time would be wrong..
Title: Re: Forum Errors
Post by: deadly7 on July 30, 2007, 09:03:36 pm
Time is off for me even though iago and I are in the same time zone. >>
Actually, no, I'm in MST. But the server is in CST and the time is correct on it. Not sure why your time would be wrong..

I dunno. All the forum posts are off for me but the proper time is being displayed... it's weird.
Title: Re: Forum Errors
Post by: CrAz3D on July 31, 2007, 07:43:38 pm
The time is off by like 9 minutes
Title: Re: Forum Errors
Post by: deadly7 on July 31, 2007, 07:47:00 pm
Time seems to have fixed itself.
Title: Re: Forum Errors
Post by: deadly7 on July 31, 2007, 07:47:30 pm
wait. wtf. I posted this at 12:55AM server time but it's displayed at 6:47 PM.. never mind! Times are broken still.
Title: Re: Forum Errors
Post by: Ergot on July 31, 2007, 08:47:41 pm
Yea... server time says "Current forum time: July 31, 2007, 07:48:20 PM" while it's 11:56 PM PST... how can you be behind me?
Title: Re: Forum Errors
Post by: Joe on July 31, 2007, 09:22:19 pm
Holy crapage iago. Just a sec. What time is it?

It's 2:31AM central according to my atomic clock, which is what the server time should be since it's Central as well. Notice it's got the date right (well, for the next 3 and a half hours) so it's actually 18 hours ahead.
Title: Re: Forum Errors
Post by: Ergot on July 31, 2007, 09:26:40 pm
No...it's currently 12:34 AM PST August 1st. The forum date is still July 31. So... it's 6 hours behind.
Title: Re: Forum Errors
Post by: iago on August 01, 2007, 08:56:05 am
For some odd reason, ntpdate is pulling the wrong time when run automatically. I just ran it manually and it's fine. I have no idea why that's happening, so I disabled the automatic updates. *shrug*
Title: Re: Forum Errors
Post by: CrAz3D on August 01, 2007, 12:26:36 pm
I should be getting off of work here in about 30 minutes, according to forum time...odd that I haven't even gone in yet lol
Title: Re: Forum Errors
Post by: iago on August 01, 2007, 12:55:19 pm
I should be getting off of work here in about 30 minutes, according to forum time...odd that I haven't even gone in yet lol
Is it still wrong? For me it says "August 01, 2007, 10:53:10 AM", which is correct...
Title: Re: Forum Errors
Post by: CrAz3D on August 01, 2007, 01:08:53 pm
lol, oops, the first time it was off I reset my profile time to match up better ::)

its right now
Title: Re: Forum Errors
Post by: deadly7 on August 01, 2007, 01:30:01 pm
abc;lajsdfkla;jdsf


Edit: k, it works.
Title: Re: Forum Errors
Post by: Joe on August 01, 2007, 04:49:23 pm
jfjfgj

Affirmative.
Title: Re: Forum Errors
Post by: trust on August 03, 2007, 10:51:31 pm
searching appears to be fubar
Title: Re: Forum Errors
Post by: iago on August 03, 2007, 11:02:12 pm
Do you mean moreso than usual? SMF's searching has always been.. unpredictable.
Title: Re: Forum Errors
Post by: Joe on August 04, 2007, 03:54:17 am
Remember, you found the exploit that allowed non-members to search and see posts in the members forum, and killed search.php.
Title: Re: Forum Errors
Post by: iago on August 04, 2007, 10:09:40 am
Surely you mean that zorm did.
Title: Re: Forum Errors
Post by: trust on August 04, 2007, 01:03:21 pm
I don't know it just kept returning an error when I tried searching yesterday. I didn't try it more than a few times though so maybe it's random.
Title: Re: Forum Errors
Post by: iago on August 04, 2007, 01:12:39 pm
Well, posting the error would have been more helpful. I thought you meant that it returned crappy results, because SMF almost always returns crappy results for searches. For example, this (http://www.x86labs.org/forum/index.php/topic,9632.0.html) is the first result when searching for "Canadian"...

For anybody who cares, here's the error:
DROP command denied to user 'smf'@'192.168.2.11' for table 'smf_tmp_log_search_topics'
File: /web/x86/web/forum/Sources/Search.php
Line: 1006

Why the hell does SMF need "drop" access in the database? That's just asking for a "drop table *" if somebody finds sql injection...
Title: Re: Forum Errors
Post by: rabbit on August 04, 2007, 01:38:00 pm
db_query("
DROP TABLE IF EXISTS {$db_prefix}tmp_log_search_topics", __FILE__, __LINE__);
$createTemporary = db_query("
CREATE TEMPORARY TABLE {$db_prefix}tmp_log_search_topics (
ID_TOPIC mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (ID_TOPIC)
) TYPE=HEAP", false, false) !== false;

It's trying to drop a temporary clone table, but you won't let it.
Title: Re: Forum Errors
Post by: iago on August 04, 2007, 02:54:18 pm
Well, I'm allowing it now. Using a temporary table sounds yucky, though, isn't there a better way to do it?
Title: Re: Forum Errors
Post by: rabbit on August 04, 2007, 07:42:38 pm
Probably.  It's probably been changed since version 2.