Page 1 of 1

Website Dead - 404 Out of Nowhere

Posted: Sat Nov 11, 2006 7:17 pm
by JoeMcManus
Hi,

My index.php is returning a 404 all of a sudden after having worked just fine (and being left untouched) for months.

404 HTTP status means file not found but the file exists just fine. If I replace it with a standard index.php with echo 'test'; it works just fine too. The robots.txt file works fine so my server, DNS etc. is all definitely 100% OK.

I tried logging in to the admin area but keep getting username & password incorrect. So I went in to the database via phpMyAdmin and changed them to something new and stilll can't get it.

Next thing I tried is restoring the database from yesterday's back-up (log files showing website responded just fine 24 hours ago). This still didn't work. But if I edit config.php to the database credentials of another website on the same server running the same version of CMSMS it works again. So the files aren't corrupt either.

Quite a mystery all...

To sum up:

DNS/Server etc. defo 100% OK.
Files OK because hooking it up with another CMSMS DB works fine.
Files OK because I checked them with Beyond COmpare with a working website on same server.
Known working database restored but still no joy.

I'm waiting for my host to retrieve the file backup just in case but it all seems to indicate that won't help either.

So I'm at the end of my admin ideas!

What can possible cause a sudden death of this little site?

The only way I know sites die all of a sudden is when the disk is full so temp files can't be written etc. Or when the database is down etc. None of that in this case. I haven't touched the files (verified this by checking the timestamps) and haven't even logged in in ages. No signs of being hacked either when looking at the access and error logs.

What can possibly cause index.php to show a 404 rather than a PHP or MySQL error?

Considering I keep getting user/pass incorrect even when resetting them in phpMyAdmin, what can possibly be wrong with the files that handle the database stuff?

Having exhausted my checklists I was hoping someone can come up with aeither a brilliant idea or a simple suiggestion that makes me go red and feel ashamed for days :) Either way, please give it a stab!

Joe

Re: Website Dead - 404 Out of Nowhere

Posted: Sat Nov 11, 2006 10:48 pm
by tsw
is it server 404 or cmsms 404 (they are quite alike)

check db username and password

change debug=true in config.php and try again

other than that I cant think of anything

Re: Website Dead - 404 Out of Nowhere

Posted: Sun Nov 12, 2006 11:53 am
by Dee
Check the (absolute) paths in config.php - maybe your hosting company moved your site's files to another location?

Re: Website Dead - 404 Out of Nowhere

Posted: Sun Nov 12, 2006 7:05 pm
by JoeMcManus
tsw wrote: is it server 404 or cmsms 404 (they are quite alike)
Browser title bar reads "404 Not Found" and the page displays

Not Found

The requested URL was not found on this server.

The actual HTTP status returns 404 according to an online tool. So I guess it's not a CMSMS error.

It runs on a dedicated server so I doubt the host has moved anything. I also verified everything was still there by Beyond Comparing it with a working site on the same server. I did just reinstate a back-up that is known to work but still no go.

I'll try the debug suggestion now.

My final hopes are that the MySQL user(permissions) for this DB have gon pearshape so I'll make a new user.

Thanks for the suggestions.

Re: Website Dead - 404 Out of Nowhere

Posted: Sun Nov 12, 2006 8:01 pm
by JoeMcManus
It's finally working again.

FYI here's the solution...

The MySQL user I had set up for this site didn't work anymore all of a sudden. I am 99.999% confident it was not touched by anyone so it must have gone bust somehow.

I made a new user with new password and granted it permission to the DB, changed config.php and voila, fixed.

As far as CMSMS having to do with this, probably nothing but it would have saved me a lot of hours if some for of error appeared rather than a non-descriptive 404. Debug = true didn't change anything in this regard so if any of the developers are reading this, may I suggest some form of error output regarding the DB connection?

As an example, if you go into your config.php file and add one character to the DB password, it breaks without useful error to a very strange 404.

Anyway, mystery solved, thanks for your assistance!

Re: Website Dead - 404 Out of Nowhere

Posted: Mon Nov 13, 2006 2:38 pm
by Pierre M.
JoeMcManus wrote: ..., may I suggest some form of error output regarding the DB connection?
I second this nice idea. I think every error path should have an appropriate error message.

BTW, thank you very much for posting the solution. Let's add it on our check lists.

PM

Re: Website Dead - 404 Out of Nowhere

Posted: Mon Nov 13, 2006 7:53 pm
by tsw
didnt debug = true print out anything reasonable about db connection?

Re: Website Dead - 404 Out of Nowhere

Posted: Tue Nov 14, 2006 11:27 am
by JoeMcManus
No, it dies to a 404 even with debug = true.

You can try for yourself by just momentarily adding a character to the DB password and switching debug = true.

Re: Website Dead - 404 Out of Nowhere

Posted: Tue Nov 14, 2006 1:04 pm
by Dee
Newer versions should give an error message when the database connection fails: "Database Connection failed"
http://viewsvn.cmsmadesimple.org/viewsv ... 4&view=rev

Re: Website Dead - 404 Out of Nowhere

Posted: Tue Nov 14, 2006 1:21 pm
by JoeMcManus
Thanks. Looks like I may not be fully up to date in that regard then. I'll check that out, cheers.