ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Lee's Random Tip #2

November 04, 2007 12:14am

Subscribe [0]
  • #1 / Nov 04, 2007 12:14am

    CI Lee

    343 posts

    Arbitrarily writing *ALL* errors to the database is in fact *NOT* a good idea.

    Interesting things happen when connections to the database fail.


    -Lee

  • #2 / Nov 04, 2007 12:25am

    CI Lee

    343 posts

    Back story…


    I have been hosting a charity site for some college kids… so they had this programmer write them an app for their project, but he does’nt live here and I did not feel like giving him shell access to my server to read logs (Seems shady like….)

    So he wrote a function that writes all errors to his database, so he can retrieve them via RSS… actually kinda sweet.

    So he sends it to the college kids to upload to me, I provided them with the info ahead of time for the DB… however the connection string was still localhost blah blah etc… I uploaded it without checking….(Not being paid for it)


    So they browse to the site…

    I swear I am balder….

    I had no idea the script tried to write errors to the database.
    I also assumed this programmer was somewhat logical in his approach to coding.

    So in the end when I finally figured out what the hell was going on, I wrote an if then else to check for db connection before trying to write to the database


    You see the issue there right?

    Tries to connect to the database and fails, tries to write that failure to the database and fails, tries to write that failure to the database…...................

  • #3 / Nov 04, 2007 12:30am

    jkevinburton

    68 posts

    I almost pissed myself!

  • #4 / Nov 04, 2007 3:21am

    Crimp

    320 posts

    What happens after it tries to write the failure to the database and fails?

  • #5 / Nov 04, 2007 4:35am

    CodeOfficer

    53 posts

    love it lee!

  • #6 / Nov 04, 2007 7:45am

    Phil Sturgeon

    2889 posts

    Thats one way to make server go boom. We need to start compiling lists of how NOT to crash your server in CI. I found a few… :-$

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases