Jump to content
Matt
 Share


What's new in IP.Board 3.1.2? SQL Error Logging

It's an unfortunate fact that something may go wrong with your hosting environment at some point. MySQL is sensitive to many things and often this results in an error being thrown. This can be confusing for you and your members and getting support for this can take time as our technicians often have to request FTP details so they can log in and check the error logs written to disk.

A lot of the time, our technicians discover that there isn't an issue with IP.Board but rather something has happened with your MySQL database or server. This can delay you getting your board back up.

With this in mind, IP.Board 3.1.2 separates out "server level" errors such as a crashed table, 'out of memory' issues and more into its own error page which is displayed.



This instantly informs you of the problem and directs you to contact your host or troubleshoot the issue further if you run a dedicated server.

In the Admin CP, we have written a log viewer which lists all the generated SQL error logs. It also keeps a record of the latest error of the day which is displayed above the list of logs.



Of course, these logs can get quite large, so when you view a log, it is "tailed" and only shows the most recent 300 lines.



We hope these features help speed up getting the correct support for when you need it most.

 Share

Comments

Recommended Comments

Very Nice!


A very good idea would be to add an option for email notification as proposed by Claudia999. It would be nice if I could get an email every time when there is a critical error that completely stops my board from operation.


I do not check my forum so often but I always check my email.

Link to comment
Share on other sites

Cool. Now I have one suggestion :D All these features and similar things about server, php, mysql, system diagnostics, error logging etc. could be under one table, because something is under System Tab, and other things are under Support tab.

Link to comment
Share on other sites

[quote name='Claudia999' date='09 July 2010 - 08:02 AM']
Hey, that's fine! Can you now integrate an information per email if sql errors happen? I'm not always in the admin CP, but almost always reach via e-mail.


That isn't possible. If IP.Board cannot communicate with the database, it cannot retrieve your Email to notify you. In addition, even if your Email was written to a file somewhere, if your MySQL server went down, you'd suddenly get 1000s of EMails, which would also bring your mail serve down.

Link to comment
Share on other sites

[quote name='Mark' date='09 July 2010 - 11:28 AM']
That isn't possible. If IP.Board cannot communicate with the database, it cannot retrieve your Email to notify you. In addition, even if your Email was written to a file somewhere, if your MySQL server went down, you'd suddenly get 1000s of EMails, which would also bring your mail serve down.


I don't see how it isn't, could you not have a simple text file in the cache folder which stores a timestamp of when the last SQL error alert email was sent and only send an email once every x amount of minutes? If the file isn't writable for some reason, don't send any emails. I'm sure the people who would like this feature wouldn't mind having an extra couple of optional settings in the initdata.php file.

Link to comment
Share on other sites

[quote name='inspire' date='09 July 2010 - 03:32 AM']
I don't see how it isn't, could you not have a simple text file in the cache folder which stores a timestamp of when the last SQL error alert email was sent and only send an email once every x amount of minutes? If the file isn't writable for some reason, don't send any emails. I'm sure the people who would like this feature wouldn't mind having an extra couple of optional settings in the initdata.php file.



Yes I do this at the moment.

Whenever the board fails with a Mysql failure, I have a email address hard coded in the php code to send me a email informing me of the problem. The code also creates a yyyy-mm-dd.lck file so that when the next request comes in a few millisecs later from another user, the code looks to see if the lck file exists and if so will not send out any more emails to me.

The only downside is that if I forget to remove the lck file after I fix the problem and another error occurs THAT DAY, I won't be told about it. But come midnight we're good to go again even if I do forget....

Link to comment
Share on other sites

[quote name='inspire' date='09 July 2010 - 10:32 AM']
I don't see how it isn't, could you not have a simple text file in the cache folder which stores a timestamp of when the last SQL error alert email was sent and only send an email once every x amount of minutes? If the file isn't writable for some reason, don't send any emails. I'm sure the people who would like this feature wouldn't mind having an extra couple of optional settings in the initdata.php file.


The issue is, we can't just stick

You are absolutely right, these things could be hardcoded in initdata.php, "impossible" was the wrong word to use, but it's something that's been discussed before and isn't as simple as one might initially think.

mail( $INFO['email'], "SQL Error", "An error was generated" );
 in the file. It would have to be language abstracted (which would require the DB connection to fetch the language choice of the user receiving the Email) and would have to support both PHP mail and SMTP mail (which again requires a DB connection to fetch the current setting and the appropriate options surrounding it).
Link to comment
Share on other sites

Nice additions, I remember discussing having an SQL log viewer within the ACP some time ago, great to see it become a reality!

Regarding the email suggestion--I do believe it is extremely worthwhile to have an emergency email address hardcoded somewhere so the (or an) Admin can be notified when a critical error occurs. I can't hover around my forum 24/7, and if my board goes down because the forum cannot connect to the database, I need to know immediately, since it sure isn't going to come back up on its own.

Thanks for your consideration,

..Al

Link to comment
Share on other sites

[quote name='Mark' date='09 July 2010 - 07:55 AM']
The issue is, we can't just stick

You are absolutely right, these things could be hardcoded in initdata.php, "impossible" was the wrong word to use, but it's something that's been discussed before and isn't as simple as one might initially think.

What about it being put into conf_global.php, where there would be an emergency email address, the method to use to try to send it as well as the message to send (which would obviously be short and to the point)? Could be created during the initial install of the board and then if it needs to be changed, it just requires an edit of a file that wouldn't be overwritten by upgrades of IPB.

mail( $INFO['email'], "SQL Error", "An error was generated" );
 in the file. It would have to be language abstracted (which would require the DB connection to fetch the language choice of the user receiving the Email) and would have to support both PHP mail and SMTP mail (which again requires a DB connection to fetch the current setting and the appropriate options surrounding it).
Link to comment
Share on other sites

The language must be abstracted for sending an emergency email about a database error? One would think that the error message is generated by MySQL anyway... so it's not like you can do that anyway. Even if the admin's primary language isn't English, one would still appreciate the warning regardless. It's not like its' something the user or board admins would have to worry about... it would be for the sysadmin.

Link to comment
Share on other sites

[quote name='Luke' date='09 July 2010 - 07:54 PM']
The language must be abstracted for sending an emergency email about a database error? One would think that the error message is generated by MySQL anyway... so it's not like you can do that anyway. Even if the admin's primary language isn't English, one would still appreciate the warning regardless. It's not like its' something the user or board admins would have to worry about... it would be for the sysadmin.


Of course it would. I mean like the Email subject and the message saying "Hey, your board is down, this is the MySQL error:". We can't hard-code English language strings.

Link to comment
Share on other sites

[quote name='Mark' date='09 July 2010 - 03:05 PM']
Of course it would. I mean like the Email subject and the message saying "Hey, your board is down, this is the MySQL error:". We can't hard-code English language strings.

You were doing it for years in the ACP, I think an exception for an "emergency" situation like this is acceptable. It doesn't have to be anything more than, "IP.Board is unable to connect to the forum database, please check your server" or something equally as short. Put the text in the conf_global.php if you must give people a way of translating it (outside of directly modifying source files).

..Al

Link to comment
Share on other sites

At the risk of repeating myself, letting the person (during install) choose what message to send would probably be best. Perhaps have a few pre-translated versions of the same message in a drop down box, with an empty box so the admin could type their own message. Something short and to the point, so the admin could have it emailed to their cell phone if they want.

Link to comment
Share on other sites

The reporting tool is nice, thanks.

I would be a voice of a different opinion when it comes to the admin notification. I would not like it added.

There are plenty of NIX savvy ways to log and notify.

Link to comment
Share on other sites



Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...