Skip to:
Content
Pages
Categories
Search
Top
Bottom

error after new post (all of a sudden)

  • A few days ago, out of the blue, users of my bbpress forum reported that submitting a new topic/post resulted in an error. Previously, my bbpress forum was working perfectly. However, over the last few days, I have verified that if you submit a new post or leave a comment, the browser takes you to bb-post.php, where the page hangs. You can verify this on my forum using user “testuser” and password “test123”.

    There are a few weird things about this:

    • I hadn’t touched the server for some time prior to this sudden problem, so it’s weird that the problem started, since I hadn’t changed anything
    • I’ve been running two bbpress forums authenticated against the same WP user table. The problem is only with the first bbpress installation, while the second bbpress installation continues to work with no problems.
    • When you post, the browser returns a 500 internal server error, and doesn’t display a “die” message, e.g. “You need to actually submit some content!”
    • Although the browser returns a 500 internal server error, the posted content does go through.

    I’ve hand-inspected http://boards.weddingbee.com/bb-post.php, and it has exactly the same PHP code as http://classifieds.weddingbee.com/bb-post.php. I’ve tried everything I can think of… I disabled plugins and Akismet, and the problem didn’t go away. (I’ve turned them back on.)

    I’m using bbPress 0.83, with bb_db_version 788. I haven’t upgraded to bbPress 0.9.0.2 yet because I’ve integrated my WordPress 2.33 install with two bbPress installs and a Mediawiki install, and it will be a ton of work to reintegrate. However, that is the next step…

    Does anybody have any ideas? :-)

Viewing 13 replies - 1 through 13 (of 13 total)
  • Another weird thing is that you can edit a post without any problem…

    I also checked my error_log, and there is no error being logged. I’m so baffled!


    chrishajer
    Participant

    @chrishajer

    Is it a mod_rewrite issue causing the problem? If you turn off permalinks and try it, does it work differently?

    I turned off permalinks (set it to false in config.php) and the error still occurred…


    chrishajer
    Participant

    @chrishajer

    I made two test posts. The both resulted in 500 errors, but they also both appeared to go through. They also took a really really long time, like something is going on in the back end. Are you sure the PHP errors are being logged? A 500 error should go *somewhere*.

    Thanks for thinking about my problem, Chris! :-)

    I don’t understand the problem either… I’m sure the PHP errors are being logged. I just triple-checked my httpd.include file, and it has this line: ErrorLog /var/www/vhosts/weddingbee.com/statistics/logs/error_log. This is the location that I’ve been looking for the PHP errors. There are other PHP notices/errors from this boards subdomain (mostly from bots looking for non-existent Front Page files), but nothing about this error.

    In the access_log, I do see lines like this:

    74.235.132.92 - - [06/May/2008:04:32:32 -0400] "POST /bb-post.php HTTP/1.1" 500 366 "http://boards.weddingbee.com/topic/second-guessing-everything" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727)"

    However, that’s not what we want…

    Last night, I did some searches and found this comment on php.net which said that the two reasons for a missing error in the error_log were “(1) you did not configure error_log output in php.ini, and (2) the script has a syntax error and did therefore not execute.” However, the script does appear to be executing at least partially, because the post/comment does post. Also, if you visit the bb-post.php page (http://boards.weddingbee.com/bb-post.php) directly, the page does execute (with a die).

    I too am confused by why the POST takes such a long time. The load average for the webserver and the database server are fairly low…


    chrishajer
    Participant

    @chrishajer

    How about configuring custom logging temporarily, just to be sure you are seeing the logged errors?

    http://us3.php.net/set_error_handler

    I think the delay in posting is not due to server load but due to this 500 error. It’s thinking about something then it fails.

    If the script had a syntax error, I would think it would fail more quickly. You can check all your php scripts for syntax errors if you have command line access if you do something like this:

    shell# find . -name "*.php" -print| xargs -n1 php -l

    (that’s “dash n one” and “php dash el”, lowercase L)

    Looks like you’re on CentOS so that should work OK.

    Thanks Chris! All my PHP scripts were OK (no syntax errors), but eliminating one more possible cause is always helpful. :-)

    It turns out that this Email Notifications plugin (https://bbpress.org/forums/topic/plugin-post-notification?replies=44) was causing the problem. After disabling that plugin, there are no “delays in posting” and there is never a 500 error. There must be a scaling problem with the plugin that started after the tables hit a certain size…

    Thanks again for your help, Chris! :-)


    chrishajer
    Participant

    @chrishajer

    Hey, I thought you said you “disabled plugins and Akismet, and the problem didn’t go away.” Maybe you didn’t disable this Email Notifications one?

    Glad you solved it, in any case.

    Chris, I did disable plugins, but I hadn’t wrapped the Email Notifications plugin function call with a function_exists wrapper, so my active theme stopped working when I did so. I then oh-so-intelligently reasoned that this plugin couldn’t be the cause of the problem, so I moved on…

    I couldn’t just disable all plugins and test with a default theme because of the existence of private forums. Finally, I moved the database to a private test server (and used a HOST file) and went through all the plugins carefully one-by-one until the problem was fixed.

    Let my idiocy be a lesson for others: wrap your plugin function calls with function_exists wrapper! :-)


    chrishajer
    Participant

    @chrishajer

    Nice troubleshooting.


    Olaf Lederer
    Participant

    @finalwebsites

    The problem is the notification plugin and it seems to be a problem if your user base becomes bigger.

    I guess the the function “notification_select_all_users” needs some update (diff. sql statement that selects less records)


    Olaf Lederer
    Participant

    @finalwebsites

    Just wrote a small bugfix for the notification plugin:

    http://www.finalwebsites.com/forums/topic/bugfix-for-bbpress-notification-plugin

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Skip to toolbar