Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
in Q2A Core by
edited by

Hi guys. I found an new error. My Q2a site working well , But  suddenly an issue begins at plugin page on admin-panel section.

in plugin page when I clicked to option it loading and finally showing an 503 error message

The error message is shown below

 Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Additionally, a 503 Service Temporarily Unavailable error was encountered while trying to use an ErrorDocument to handle the request.

and it redirected to an URL with the above 503 error message


But in the errorlog file shows an mysql error. that is also shown below

[2014 04:42:43 Etc/GMT] PHP Question2Answer MySQL query error 2006: MySQL server has gone away - Query: (SELECT 'options' AS selectkey, title, content FROM qa_options) UNION ALL (SELECT 'time', 'db_time', UNIX_TIMESTAMP(NOW()))

Actually what was the exact issue and how to fix this issue. Please help as soon as possible

Thanks ...



EDIT ON 30.10.2014

I wrote a custom query to fetch the details of qa-option table in index.php. And getting the data from that table without any issues.

 The query is

 $sql = "(
SELECT 'options' AS selectkey, title, content
FROM qa_options

SELECT 'time', 'db_time', UNIX_TIMESTAMP( NOW( ) )

if (!$sql) {
    die('Invalid query: ' . mysql_error());
$retval = mysql_query($sql);
if(! $retval )
  die('Could not get data: ' . mysql_error());

echo ' got the data';


And I got the values. So only problem when the admin page option button. So what was the issue on my q2a site option button. Is there any file missing Or any other issue.



Q2A version: version 1.6.3
Hmm... there is no valid reason for a query to the options table to break in the admin page and not in any other page. Actually, the admin page is one of the lightest ones in terms of DB access (compared to the question list, for instance). I would copy the whole SQL statement that breaks. Run it against the DB. Analyse the result (for instance, how many records are returned or how many milliseconds it takes). After finding out that it should be around a few hundred results and a few milliseconds I would ask the hosting provider for an explanation on why such a simple query that returns so little results is timing out. It should only take milliseconds, even in old hardware.
Hai , I wrote a custom query on index.php and it works well. Please look my post I edited for new updates
edited by
@ pupi : Thanks for supporting me :)

 I deleted all the third party plugins. Now its working well.
But after restoring it again showing the same issue :(
1. Check if you have 2 fields/columns called "oemail" and "ohandle" in your ^userlogins table. Also check if you an "oemail" column in your ^users table. Confirm the 3 of them.

2. If the answer is NO for the 3 of them then also let me know if you have ALTER privilege with your MySQL user.

3. What is your "QA_MYSQL_TABLE_PREFIX" ? You can find it in qa-config.php file and it is usually "qa_"

3 Answers

+3 votes
selected by
Best answer

It may be issue related to init_queries(). qa-include/qa-page-admin-plugins.php (around L81)

foreach ($moduletypes as $type) {
  $modules=qa_load_modules_with($type, 'init_queries');
  foreach ($modules as $name => $module) {
      if (!empty($queries)) {
        if (qa_is_http_post())
          $qa_content['error']=strtr(qa_lang_html('admin/module_x_database_init'), array(
            '^1' => qa_html($name),
            '^2' => qa_html($type),
            '^3' => '<a href="'.qa_path_html('install').'">',
            '^4' => '</a>',

Check method:

  1. Once all remove all third-party plugins from your qa-plugin folder
  2. Check 403 error after you restore one by one
Yes bro after deleting all third party plugins, It works smoothly.
How to check after restore . Please help. Because after restore it seems again the same issue
I did not get the 403 checking method. Please tell
Are you restore the plugin "one by one" ?
Is phenomenon same in any plugin?
@ sama55 : Yes, You are correct. :)
 I deleted all the third party plugins. third party plugins used in my site

1) q2a-open-login-master
2) q2a-custom-404-page-master

and added one plugin first q2a-custom-404-page-master. same issue occurs.
So deleted and uploaded q2a-open-login-master. It working so It may be the issue of q2a-custom-404-page-master right?.

Thanks for the support
+2 votes

Have a look at this article .

I would check first if you are in the 3rd situation, that is "if you send a query to the server that is incorrect or too large"

If your website is not in production (that is your users are not accessing to it) , you could make this change in the qa-config.php file :

from :

define('QA_DEBUG_PERFORMANCE', false);

to :

define('QA_DEBUG_PERFORMANCE', true);

and see if you get more infos on what's happening when you click on the "option" link.

EDIT : I've corrected "true" and "false", I had reversed them :-)

edited by
*in this question* issue not solved. I cant edit any value from admin forms. Now I am updating through Database via workbench.
But after deleting qa-open-login-master (third party plugin). It will working fine
Again : deleting plugins is not a solution. You should find the issue and solve it.
yes it may be the server issue. I am using sharing host . I worked last previous two weeks without any issues. But last week suddenly found this issue. I think it may be some server isssue. What do you think about this issue . Any suggestions

You did not provide any details....
However it looks like to be a different issue from the one you was talking about in this question, so I think you should open another question, or, if you think so, you could "ask a related question".
But if I were in you I would solve first the connectivity problems that you have on your server.
See : http://www.question2answer.org/qa/40150/q2a-open-login-are-not-working-on-my-site-now?show=40164#c40164
+1 vote
edited by

1. System configuration

If your web server (Apache, NginX, etc) and database server (MySQL) exist on the same server (hardware), you should try to changing system parameter of qa-config.php (around L166). This change reduces the load on your server, and performance of your site will be improved. As a result, you may be able to avoid the phenomenon.

Before (Current setting):

define('QA_OPTIMIZE_LOCAL_DB', false);


define('QA_OPTIMIZE_LOCAL_DB', true);

2. Size of your qa_options table

You should change again the system configuration of the qa-config.php according to the advice of maxj. And, report the number of records of qa_options table on your debug panel (bottom of page). If this number is very large (more than 5000, 10000, 100000, etc), you might need to remove the unnecessary records in the qa_options table.

Before (Current setting):

define('QA_DEBUG_PERFORMANCE', false);


define('QA_DEBUG_PERFORMANCE', true);

Example of debug panel:

SELECT title, content FROM qa_options
13.31 ms - 1841 rows - 2 columns

3. MySQL configuration

If you are using VPS or dedicated server, you need to check MySQL configuration below (my.cnf). You may be able to check these settings in phpMyAdmin.

etc ...


Ok I am going to try. Please help ... Thanks
Hai , I wrote a custom query on index.php and it works well. Please look my post I edited for new updates
I got it. Refer also to my next answer.