Page 1 of 1

The (not so helpful) but secure, "url was not found on this server" error

Posted: Thu Jun 01, 2006 7:41 pm
by wesyah234
I've been getting the 404 error intermittently with my current install (.13)  Granted, I moved to a new webhost at the same time I upgraded to .13, so I"m not entirely sure it's due to the .13 upgrade.

The hosting provider assures me that nothing strange is happening on the server, ie, database connectivity is up, plus, other mysql based websites are working on the same domain...

To try to diagnose, I turned on the debug flag in config.php, however, this didn't provide me any more information, still got:

Not Found

The requested URL was not found on this server

I was hoping this flag would cause a mysql error message or something like that to be printed.

Since it didn't, I added a line of code to send myself an email (with the mysql_error() in the body of the mail), and I'm now just waiting for it to happen again.

Anyone have any suggestions on what could be causing the 404?  I plan to look into the code more closely, but I know for sure that db errors can cause it, since I set the wrong db password in the config file and it happened.

Also, a suggestion: maybe the code could be changed to send email to the admin of the CMS if ever a 404 error is returned to a browser, or maybe write a log file somewhere.  I understand the desire to hide mysql errors, but there should still be a way for an admin to see the cause of the problem.

Thanks,
Wes

Re: The (not so helpful) but secure, "url was not found on this server" error

Posted: Thu Jun 01, 2006 7:52 pm
by calguy1000
404 errors usually (in the case of apache) go into the error_log, you just need to find it and take a look.

since I have shell access to my own machine, my apache logs are in /var/log/httpd

but on one plesk server I've worked on the logs were located in  a "statistics" directory under the virtual root.

Re: The (not so helpful) but secure, "url was not found on this server" error

Posted: Thu Jun 01, 2006 7:58 pm
by wesyah234
I know, but this isn't a true 404 error from apache, it seems to be manufactured by CMSMS, in this function in libs/misc.functions.php:

function ErrorHandler404()
{
        #if ($errno == E_USER_WARNING) {
                @ob_end_clean();
                header("HTTP/1.0 404 Not Found");
                echo '

404 Not Found

Not Found
The requested URL was not found on this server.
';
                exit();
        #}
}


which is called for some situations from index.php

So, what I'm wondering, is what could have gone wrong in CMSMS, to cause it to call this function?

Re: The (not so helpful) but secure, "url was not found on this server" error

Posted: Mon Jun 05, 2006 6:12 pm
by wesyah234
This is happening again, only this time, I've edited the cmsms function that creates the 404 page and had it email me the current mysql error.

It emailed me the following:

User myusername_cmsms has already more than 'max_user_connections' active connections

Is there anything I can do in the cmsms config to avoid this?

Web host's support dept is currently unresponsive on this issue.

Web searching leads me to think changing from mysql_pconnect to mysql_connect may solve the problem. Can this easily be changed?

Any other ideas?

Re: The (not so helpful) but secure, "url was not found on this server" error

Posted: Mon Jun 05, 2006 6:38 pm
by Piratos
max_user_connections
This is the number of simultaneous clients allowed with mysql.

If you have a big number of visitors on the same time that can transpired.

Be happy with many visitors and talk with your provider to increment this number.
from mysql_pconnect to mysql_connect may
Change config.php this part to this:

Code: Select all

$config['persistent_db_conn'] = false;

Re: The (not so helpful) but secure, "url was not found on this server" error

Posted: Mon Jun 05, 2006 6:50 pm
by wesyah234
Thanks... I've changed the setting in config.php

Web host says max connections is set to 50, however apache access log only showed about 3 unique visitors in a 20 min period before the error occurred... so something else strange is happening, don't know what it is.

In the meantime, it is working again... so I'll just wait and see.

Re: The (not so helpful) but secure, "url was not found on this server" error

Posted: Mon Jun 05, 2006 7:03 pm
by Piratos
The number of persistent connections is normal very small - that can be the error.