check my amazon wishlist


CoreMedia vs. TYPO3

TIMTAB latest builds

stable:
v0.5.11 from TER
bug fix: commenting was possible although disabled for a post

unstable:
2006-04-15

what's new in unstable:
Ready for TYPO3 4.0.0. Trackback routines reorganized. Now Trackbacks will be sent only when the post is not hidden. Please test wether Trackbacks are working when writing post with tools like w.bloggar.

renner

Coding Night Wannabe an Apple? Robert Sebastian Session Robert

Archives

Categories

Buddies and others

del.icio.us links del.icio.us linkage




    Powered by Technorati



    Disclaimer

    I just brought the site back to life so that people can stop reminding me that it's down. Please note that probably most if not all content is outdated. I'll try to update stuff as soon as possible.

    best Ingo

    10
    Oct
    2006

    debugging SQL errors


    I recently had some trouble with a bigger site I was working on. PHP error messages kept apearing very randomly as a result of incorrect MySQL result pointers.

    As I couldn't reproduce the errors on a test system I wrote a small extension to log the errors. But as it was a live system it wasn't possible to just debug() the errors. I also wasn't too eager to write them to a text file and so I used t3lib_div::devLog() to log the errors.

    To view the errors there's the wonderful cc_devlog extension from René which is required before installing the extension.

    So when an error occurs now it will get logged to the DB together with the time the error occured, from where it was called, an error message, what query caused the error and a backtrace to the source.

    With that I was able to trck down the error even without having to output debug messages to the frontend and still having the site online.

    Download EXT:user_debug_sql.

    comments

    #1 | Roland commented on Tuesday, 10-10-06 08:46

    Gravatar: Roland

    Do you mind to share with us what caused the problems? maybe we will run into the same problem...
    Roland


    #2 | Thomas commented on Tuesday, 10-10-06 09:21

    Gravatar: Thomas

    Hi,
    oh that sounds. I often played around with writing such a thing but it never became reality.
    I think than will help me a lot in the future.

    Greets,
    Thomas

    P.S.: I think it's really the time to send you a donation. ;-)


    #3 | Ingo commented on Tuesday, 10-10-06 09:33

    Gravatar: Ingo

    Roland: ehh yes, it was MySQL error 1030 or so saying that the storage engine got error 28 ... blah blub ... after researching the numbers and messages it came out that somehow MySQL was using too much temporary memory and thus running out of disk space when building results I guess. Moving the temp directory of MySQL to a different partition seemed to help.


    #4 | Michael Stucki commented on Wednesday, 11-10-06 11:59

    Gravatar: Michael Stucki

    Hi Ingo,
    nice work! Just one comment: The backtrace is not very useful because it only contains a reference to the function that triggered the error. However, if I would like to see where this has been called from, I would rather need the full backtrace instead of just the current call.
    Can you add an option to store the full backtrace instead?

    - michael

    PS: Of course I found it great if this would be in cc_devLog directly :-)


    #5 | Andreas Otto commented on Wednesday, 11-10-06 16:20

    Gravatar: Andreas Otto

    Hi Ingo, hi Michael,
    we could ask René if he would like to add this, or if he wants to transfer ownership.
    Cheers,
    Andreas


    #6 | Ingo commented on Wednesday, 11-10-06 16:51

    Gravatar: Ingo

    well, it just uses cc_devlog to log the errors. I think these two extensions are things for their own that shouldn't go together. The only thing I'd like to see is that the htmlspecialchars() for the output is removed. That's why I had to XCLASS cc_devlog...


    #7 | Michael Feinbier commented on Monday, 13-11-06 14:34

    Gravatar: Michael Feinbier

    Thanks Ingo!

    That little extension helped us very much :)


    #8 | Ingo commented on Monday, 13-11-06 18:57

    Gravatar: Ingo

    Like always: If it was helpful, especially if you make money with it, to you in any way, please donate!


    Sorry, comments are closed for this post.