Advertisement:

Author Topic: Cannot access error log in Admin  (Read 674 times)

Offline awolexpat

  • Jr. Member
  • **
  • Posts: 116
Cannot access error log in Admin
« on: June 16, 2012, 12:18:24 PM »
Hi everyone,
Apologies if this has been covered elsewhere but a search didn't reveal it. I have the oddest problem in that whenever I click on my error log link(s) I get a blank white screen. I can access all the other logs except that one. This has only become apparent to me today and before it was working as it should. Everything else (I think) is working OK. I have downloaded the error log from my cPanel and the relevant entry (I think) is the following:

Quote
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 77393921 bytes) in /public_html/forum/Themes/default/Errors.template.php on line 162

However I think this error may just be symptomatic of some other problem, as I have a similar error for several other files, such as:

Quote
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 77393921 bytes) in/public_html/forum/Sources/Load.php(2442) : eval()'d code on line 162

and

Quote
PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 77391722 bytes) in /public_html/forum/Sources/Twitter/TwitterHooks.php on line 401

There is also this little bunch of errors prior to those which have repeated as well:

Quote
PHP Notice:  Use of undefined constant WIRELESS - assumed 'WIRELESS' in /public_html/forum/Sources/Subs.php on line 2821
PHP Notice:  Use of undefined constant WIRELESS_PROTOCOL - assumed 'WIRELESS_PROTOCOL' in /public_html/forum/Sources/Subs.php on line 2832
PHP Notice:  Undefined index: REQUEST_URL in /public_html/forum/Sources/Subs.php on line 2952

Prior to those there is an absolute avalanche of the following error, which prompted me to turn off the relevant mod (Bad Behaviour) which when i looked today at the mod page is not currently available for download, so makes me wonder if there is a connection.

Quote
PHP Fatal error:  require_once(): Failed opening required '/public_html/forum/Sources/bad-behavior/bad-behavior/banned.inc.php' (include_path='.:/usr/php/53/usr/lib64:/usr/php/53/usr/share/pear') in /public_html/forum/Sources/bad-behavior/bad-behavior/core.inc.php on line 24

However I still could not access the error log after turning it off, as well as logging out, clearing the browser cache and logging in again. I have spoken to my host on their live chat and went through a few possibilities but nothing has changed.They upped the memory in the php.ini as well but to no avail. So I am a bit stumped. I use SMF 2.0.2 and have a ton of mods (more than 60), but the only recent change has been to update Simple Portal to the latest version, and also TapaTalk and Bad Behaviour. I also installed the beta EU Cookie Law one but that, Tapatalk and BB were last Sunday (10th June) and I have been accessing the error log since then. In terms of timing Simple Portal is the possible culprit but no one else is (apparently) having this problem, so that's why i am posting.

Anyone got any ideas? (Please...)

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,247
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Cannot access error log in Admin
« Reply #1 on: June 16, 2012, 12:34:03 PM »
Would you try truncating the log table by running this query from phpmyadmin:

Code: [Select]
TRUNCATE TABLE `smf_log_errors`
Where smf_ is your table prefix.
Home of Elmacik

Offline awolexpat

  • Jr. Member
  • **
  • Posts: 116
Re: Cannot access error log in Admin
« Reply #2 on: June 16, 2012, 10:36:39 PM »
Many thanks Elmacik, that has allowed me to access the error log. If at all possible, can you explain why this might have happened and how I can avoid it happening in the future?

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,247
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Cannot access error log in Admin
« Reply #3 on: June 18, 2012, 01:58:26 AM »
Probably you had countless of errors logged, and since it was too big; it was exhausting the server to show you the results. How you can avoid this? Turn on error logging for a little while; go to board index and view an arbitrary topic. Then disable error logging again and see what you have in the logs. Fixing those errors will help.
Home of Elmacik

Offline awolexpat

  • Jr. Member
  • **
  • Posts: 116
Re: Cannot access error log in Admin
« Reply #4 on: June 18, 2012, 11:48:58 PM »
Thanks again, and I will do as you suggest; no further problems since your fix so I am guessing that you are right - I have been a little slack in dealing with the errors that appear and thought I should leave them until I had some spare time! Actually I think it would be a good idea if some of the more common error messages were referenced on SMF to explain both what they mean and how to deal with them - I'm sure there are others like me who don't have much idea on the best way to handle the different types of error, how important they are or how they crop up in the first place. It would be great if there was some sort of mod that could assist in identifying or helping with this alternatively. I'm sure it would cut down the number of help requests on this forum!

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,247
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Cannot access error log in Admin
« Reply #5 on: June 19, 2012, 03:57:53 AM »
It's nearly impossible to solve those kind of errors with an automated script. Because there are tons of customizations which are already being checked for errors before approval. Think of that a couple of knowledgeable people look for it and cannot find; how comes that an automated script finds and understands and solves. :P

It could only lead you to the place where the error is happening; and this is what SMF error logging does already.
« Last Edit: June 20, 2012, 01:37:30 AM by Elmacik »
Home of Elmacik

Offline awolexpat

  • Jr. Member
  • **
  • Posts: 116
Re: Cannot access error log in Admin
« Reply #6 on: June 19, 2012, 01:03:35 PM »
OK, that's fair enough, just an idle thought really. I still think some sort of repository of errors on SMF would be a useful addition though, as a starting point for people before they come to the forum asking for help. The problem I often find is that the linked line of code that is highlighted as 'causing' the error rarely is the root cause, which can be very confusing when it is encountered.