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

i'm using Q2A with sigle sign on feature. It is working for admin user.  but i am getting the following error while posting, commenting and voting by other  users.

 

A Question2Answer database query failed when generating this page.

A full description of the failure is available in the web server's error log file.

 

 It is working fine without single sign on.

Q2A version: 1.6.3
by
There is no error statement in error log file
by
Check your php.ini settings and enable the display of errors :
- display_errors = On (to log them on your browser)
- log_errors = On (to log them on the error log file; check also that the error_log variable has been commented out)
- error_reporting = E_ALL & ~E_DEPRECATED
by
Above you mentioned  statements are enabled in php.ini
by
And don't you see anything in the Apache error.log file ?
by
yes.. there is no statements
by
Does it show the SQL error if you have the setting QA_DEBUG_PERFORMANCE set to true in qa-config.php?
by
it shows the following  error in php_error_log file :

PHP Question2Answer MySQL query error 1452: Cannot add or update a child row: a foreign key constraint fails (`q2a`.`qa_userfavorites`, CONSTRAINT `qa_userfavorites_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `qa_users` (`userid`) ON DELETE CASCADE) - Query: INSERT IGNORE INTO qa_userfavorites (userid, entitytype, entityid, nouserevents) VALUES ('2', 'Q', 5, 0)
by
Thank you so much Scott and maxjtechno.  

i changed all foreign key reference as shared users table key. Now it is working fine.

Please log in or register to answer this question.

...