Q&A Problem - 404 error

I've installed Q&A to test to see how it may work for my 3.1.1 multisite installation.
1. I uploaded via ftp and activated in main site.
2. I created a custom menu via link to mysite/questions/ask.
3. Configured settings for users.
4. Added some categories.
5. Went to main page - clicked on the menu and got a 404 error

What did I miss? By the way, I am trying to understand the functional differences between this plugin and a forum plugin? They both provide user asked questions and responses. Is it just in the ratings aspect?

  • cshrimpt

    I have found that adding this to my WP sites that were upgraded from 3.0.4 to 3.1.1 gives me a 404 error. When I add it to a new install with a new db it works (for the most part).

    Clearing the WP directory on my server and reinstalling on an upgraded site doesn't help. This leads me to believe that the 3.1.1 upgrade did something to the database that messes up internal rewrites. In addition to the Q&A plugin, I also have lots of issues with category permalinks breaking on upgraded sites.

  • scribu

    No, Marketpress is compatible.

    Here's a plugin that will log when rewrite rules are flushed:

    https://gist.github.com/raw/950875/b38a065d607b543752750acddbccc29551fc8436/log-rewrite-flush.php

    After installing and activating it, go the the admin dashboard. If you see some code, paste it here.

    If you don't see anything, it means the problem is more complex and you will have to figure out which is the faulty plugin by hand:

    0. Deactivate all plugins.
    1. Visit settings -> Permalinks so that the rewrite rules are flushed.
    2. Go to /questions/ask and see if it works.
    3. Activate one plugin.
    4. Go to step 1.

    Or, you could do a binary search: activate half the plugins. If it works, it means it's in the other half. If it doesn't work, it means it's in this half. Then repeat, only with the half of the plugins you know might be the problem.

  • Saunt Valerian

    @Scribu Right, I installed the debugging script above and it returned this feedback in the dashboard:

    #0  log_rewrite_flush(rewrite_rules) called at [(null):0]
    #1  call_user_func_array(log_rewrite_flush, Array ([0] => rewrite_rules)) called at [/home/teatrade/public_html/wp-includes/plugin.php:395]
    #2  do_action(delete_option, rewrite_rules) called at [/home/teatrade/public_html/wp-includes/functions.php:657]
    #3  delete_option(rewrite_rules) called at [/home/teatrade/public_html/wp-includes/rewrite.php:1877]
    #4  WP_Rewrite->flush_rules() called at [/home/teatrade/public_html/wp-admin/options-permalink.php:125]

    I flushed the permalinks by changing to default, saving, and then changing back to a preferred setup and then saved again.

    I get the 404 error when visiting the unanswered and ask pages. Here's a link to my questions section: http://teatra.de/questions/

  • antKat

    Activating the Log Rewrite Flush:

    #0 log_rewrite_rule_changes(rewrite_rules)
    #1 call_user_func_array(log_rewrite_rule_changes, Array ([0] => rewrite_rules)) called at [/home/content/31/7500231/html/sportslife/wp-includes/plugin.php:395]
    #2 do_action(delete_option, rewrite_rules) called at [/home/content/31/7500231/html/sportslife/wp-includes/functions.php:657]
    #3 delete_option(rewrite_rules) called at [/home/content/31/7500231/html/sportslife/wp-includes/rewrite.php:1877]
    #4 WP_Rewrite->flush_rules() called at [/home/content/31/7500231/html/sportslife/wp-content/plugins/avatars/avatars.php:240]
    #5 Avatars->flush_rules()
    #6 call_user_func_array(Array ([0] => Avatars Object ([network_top_menu] => settings.php,[network_top_menu_slug] => network/settings.php,[current_version] => 3.5.4),[1] => flush_rules), Array ([0] => )) called at [/home/content/31/7500231/html/sportslife/wp-includes/plugin.php:395]
    #7 do_action(init) called at [/home/content/31/7500231/html/sportslife/wp-settings.php:298]
    #8 require_once(/home/content/31/7500231/html/sportslife/wp-settings.php) called at [/home/content/31/7500231/html/sportslife/wp-config.php:99]
    #9 require_once(/home/content/31/7500231/html/sportslife/wp-config.php) called at [/home/content/31/7500231/html/sportslife/wp-load.php:30]
    #10 require_once(/home/content/31/7500231/html/sportslife/wp-load.php) called at [/home/content/31/7500231/html/sportslife/wp-admin/admin.php:30]
    #11 require_once(/home/content/31/7500231/html/sportslife/wp-admin/admin.php) called at [/home/content/31/

    Avatars again! I do have the WPMUdev Avatars(BB/MultiSite) installed, although it was deactivated at time of this flush. Scribu, recall when you did the temporary fix that initially corrected the 404 but indicated a problem with my WYSIWYG editor that you thought was caused by the theme. You were etting the following submit error: Uncaught syntex error, unrecognized expression: [src*=gravatar.com/avatar. Since you thouht this was a problem from the theme, I created a test site on the same network with the particular theme in question with Q&A being the only plug/feature - and Q&A works fine, so it doesn't seem to be a problem with the theme. I hope this helps solve the puzzle. Let me know if you need me to do anything else.

  • Saunt Valerian

    Got it. Reactivated the flush log plugin and let it run.

    This is the output from normal site use (not a manual flush)

    #0  log_rewrite_flush(rewrite_rules) called at [(null):0]
    #1  call_user_func_array(log_rewrite_flush, Array ([0] => rewrite_rules)) called at [/home/teatrade/public_html/wp-includes/plugin.php:395]
    #2  do_action(delete_option, rewrite_rules) called at [/home/teatrade/public_html/wp-includes/functions.php:657]
    #3  delete_option(rewrite_rules) called at [/home/teatrade/public_html/wp-includes/rewrite.php:1877]
    #4  WP_Rewrite->flush_rules() called at [/home/teatrade/public_html/wp-admin/options-permalink.php:125]

    It is the same as when I ran the manual flush, though I have to idea what it all means or how to interpret it.

  • Saunt Valerian

    hmmm, interesting.... I updated to 1.0.1 and the 404 error is gone now...sort of....

    The various pages for the Q&A plugin load now, but the page title still shows as "Page not found" and the breadcrumbs (I have them displayed for now while I work through this) display as Home / Error 404. And 404 Error still comes up in the source code.

    So it's still throwing the 404 error, but also managing to render the Q&A page at the same time. http://teatra.de/questions/ask/

    I do suspect this might be theme related since Q&A works awesome in the Studio theme.

  • Saunt Valerian

    This is the only instance of wp_title in my header.php
    <title><?php if(is_front_page()) { bloginfo('name'); } else { wp_title( '', true, 'right' ); }?></title>

    ...though I don't understand what it is doing or what to do if this is an overwrite.

    In the source code for the pages I'm getting
    <title>Page not found - Tea Trade</title>

    and in later on at the start of the body section:
    <body class="logged-in error404 ask-question">

  • chernitzky

    Hello

    I'm sorry I did not realize the follow up was moved to this thread, I will move my post here. Thank You for your help.

    Hello: I am having the same issue... I have tried everything you suggested. Here is the error code I am getting from the log. the site is http://beer.vg we want to make a beer Q&A...

    Thank you in advance for your help

    #0 log_rewrite_flush(rewrite_rules) called at [(null):0]
    #1 call_user_func_array(log_rewrite_flush, Array ([0] => rewrite_rules)) called at [/home/beervg/public_html/wp-includes/plugin.php:405]
    #2 do_action(delete_option, rewrite_rules) called at [/home/beervg/public_html/wp-includes/functions.php:667]
    #3 delete_option(rewrite_rules) called at [/home/beervg/public_html/wp-includes/rewrite.php:1877]
    #4 WP_Rewrite->flush_rules() called at [/home/beervg/public_html/wp-admin/options-permalink.php:125]