Behaviour Records hangs after submitting problems

Hi all i am having an other problem with Behaviour Records when teachers are writing Behaviour Records the page just get stuck after clicking submit button, the page looks like its going to load back to Behaviour Records page with the newly report but it doesn’t it just hangs on the Add page and then times out saying
(((( Gateway Timeout The gateway did not receive a timely response from the upstream server or application. Additionally, a 504 Gateway Timeout error was encountered while trying to use an ErrorDocument to handle the request… )))))
i thought it might be the max_input_vars so i used it to 10000 just to see if that was the problem but after doing that i am getting the same issue anyone know what might be causing this to happen?

PS i had this problem before on a shared hosting server with hostgator and never figured out what the problem was even with help from HostGator Tec team, thats why i moved to our own server which has been running now for 2 to 3 months fine and now the problem is back once more.

I for got to say i have restarted the router and the web server with no luck to fixing the problem, note that our web server is on the same local network as the class room computers but they access the web server VAI the public IP address as any one outside of the school would like a parent at home.

Orlando, this is a very unusual problem. Have you checked your PHP error logs to see if that sheds any light on the issue? Ross.

Hi Ross

Please find the Error log from the Behaviour folder can’t make heads or tails of it hope you might find why i am having the problems thanks

Orlando,

Two possible issues are shown below:

PHP Warning: require(/home/svserver/public_html/teachersadmin/lib/PHPMailer/PHPMailerAutoload.php): failed to open stream

PHP Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000]: General error: 2006 MySQL server has gone away’

The first is just a warning, and whilst it sounds serious, the result should be emails (probably notifications) not being sent out, rather than total failure.

The second, which occurs around 300 times in the error file you sent is much more serious, and would explain the behaviour you are seeing. What might cause your MySQL server to have “gone away” I can’t say. I’ve seen cases where a server gets hit with lots of requests by an attacker, and this causes memory exhaustion, leading to MySQL failing to respond, so that is one option, but there are plenty of others.

What server OS and version are you running?

Ross

Hi Ross i am running CENTOS 7.3 x86_64 standard – server cPanel & WHM 64.0 (build 29)
i know at the end of the day around 14 to 15 of our teachers log on to input data and each of them have there own user and password could this be casing the problem when alot of users try to log on round the same time and if so how can i fix this problem thanks orlando

@orlando Are you still experiencing the same problem? were you able to solve? If not please let me know we try to debug it together.

Hi Jmsperu no i was not able to fix the problem still ongoing let me know what you would need from me to enable a solotion to this problem.

thanks orlando

Well you can send me an email on james.peru@xcobean.org Then we can go through the issue step by step

Hi Jasperu and Ross i think i found what the problem is and need your help to fix it i had a look at the error logs today and found ((((( [07-Jul-2017 13:48:23 Europe/London] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /home/svserver/public_html/streetvibes.academy/functions.php:4031
Stack trace:
#0 /home/svserver/public_html/streetvibes.academy/index_notification_ajax.php(43): getSettingByScope(NULL, ‘System’, ‘alarm’)
#1 {main}
thrown in /home/svserver/public_html/streetvibes.academy/functions.php on line 4031
))))))
I had a look at the functions.php file on line (( 4031 )) and found a syntax error X icon next to

$rollGroups[$count][3] .= “\$(".show_hide-$count2").click(function(){”;

Any ideas why this is happening ? i think this is my problem to my
Behaviour Records hangs

Sorry i meant on line 687

Hi all i went back and change my php from ea-php70 to ea-php55 that seem to fix the error on 687 in functions.php not sure if it has fixed my Behaviour Records hangs its late Friday and all the staff has gone home so will have to wait till Monday and let you all know if the problem came from using PHP Version ea-php70

Orlando, OK, that is interesting. Let us know how you get on. PHP7 should work fine, that is what @ross and I both run for our schools in production, with no issues.

In terms of capacity, it depends on your hardware as much as your server software. As a point in reference, I run a single HP Proliant server for my school of 1500+ users. It is 8 years old, has a quad-core Intel Xeon processor and 10GB of RAM. Even when we are making heaving use of the system for teaching and learning with 200+ users on the site at the same time, it rarely runs over 5% utilisation.

So…I don’t think it is a capacity issue causing your issue…but I guess it could be some kind of resource locking issue.

Ross

Hi Ross i had staff try yesterday and the problem is still there on PHP55 so your right its not that so i am at a lost ? do you think this is a database problem or php problem i am thinking to just reinstall Gibbons and link it back to the database but this is only good if the problem is with the site files? i had a look at my error logs today and i am getting alot of errors from line 4031 in functions.php have a look

#0 /home/svserver/public_html/streetvibes.academy/index_notification_ajax.php(43): getSettingByScope(NULL, ‘System’, ‘alarm’)
#1 {main}
thrown in /home/svserver/public_html/streetvibes.academy/functions.php on line 4031
[30-Jun-2017 15:23:58 Europe/London] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /home/svserver/public_html/streetvibes.academy/functions.php:4031
Stack trace:
#0 /home/svserver/public_html/streetvibes.academy/index_notification_ajax.php(43): getSettingByScope(NULL, ‘System’, ‘alarm’)
#1 {main}
thrown in /home/svserver/public_html/streetvibes.academy/functions.php on line 4031
[07-Jul-2017 13:48:19 Europe/London] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /home/svserver/public_html/streetvibes.academy/functions.php:4031
Stack trace:
#0 /home/svserver/public_html/streetvibes.academy/index_notification_ajax.php(43): getSettingByScope(NULL, ‘System’, ‘alarm’)
#1 {main}
thrown in /home/svserver/public_html/streetvibes.academy/functions.php on line 4031
[07-Jul-2017 13:48:23 Europe/London] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /home/svserver/public_html/streetvibes.academy/functions.php:4031
Stack trace:
#0 /home/svserver/public_html/streetvibes.academy/index_notification_ajax.php(43): getSettingByScope(NULL, ‘System’, ‘alarm’)
#1 {main}
thrown in /home/svserver/public_html/streetvibes.academy/functions.php on line 4031
[07-Jul-2017 13:48:36 Europe/London] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /home/svserver/public_html/streetvibes.academy/functions.php:4031
Stack trace:
#0 /home/svserver/public_html/streetvibes.academy/index_notification_ajax.php(43): getSettingByScope(NULL, ‘System’, ‘alarm’)
#1 {main}
thrown in /home/svserver/public_html/streetvibes.academy/functions.php on line 4031
[07-Jul-2017 13:48:43 Europe/London] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /home/svserver/public_html/streetvibes.academy/functions.php:4031
Stack trace:
#0 /home/svserver/public_html/streetvibes.academy/index_notification_ajax.php(43): getSettingByScope(NULL, ‘System’, ‘alarm’)
#1 {main}
thrown in /home/svserver/public_html/streetvibes.academy/functions.php on line 4031

has anyone had a look at my 4031erros ? please can anyone tell me why i am getting it

@orlando
Is there a way I can see the error being generated? Like to replicate the issues, see the error log or something…

Orlando, I am on the road with limited tech for another 8 days, but will reply on return to action. Sorry! Ross.

Thats fine and thanks for the reply

Hi jasperu the text above was lifted from the error logs i can tell you that i have setup a other test gibbons website and i am not getting any errors from line 4031 in functions.php i then moved my phpmyadmin database of the main site with the problem over to the new test site and the problem came back so the issue is in my phpmyadmin database for the main site somewhere

Orlando, interesting case. It seems that the issue is originating on line 43 of /index_notification_ajax.php, which is attempting to pass a NULL value as the database connection. The question is, what is causing the database to be null. I am wondering if this is to do with a timeout issue. Is it happening as soon as you log in, or only after a certain duration? Ross.