503 Service Temporarily Unavailable

503 Service Temporarily Unavailable

by Russell Thomson -
Number of replies: 7

I have the latest Moodle 3.7.2+ on Windows 7 
I am being constantly logged out and often receive the following message:
503 Service Temporarily Unavailable nginx
I have contacted the web hosting service and they say that they have checked the hosting plan and there is no problem.
Is there anything else in Moodle that can cause this problem?
Regards

Average of ratings: -
In reply to Russell Thomson

Re: 503 Service Temporarily Unavailable

by Ken Task -
Picture of Particularly helpful Moodlers

Uhhh ... nginx doesn't run on Windows so you must mean you use a Windows workstation and the Nginx server (linux) reports a 503 ... temporairly unavailabe.  That error is somewhat illusive ....

There could be some related errors in your nginx server error logs ... or php error logs.   So check those.

Are you running autobackups?  Anything that would cause server to be busy and not accept new connections.

Is your cron job/task running as it should ... every minute is current recommendation by Moodle HQ.

Would think the moodle is setup to use files for sessions and not database.   Check that .... use files for sessions.

If you are using files for sessions double check owerships/permissions on moodledata/sessions directory.

Do you have any additional protections for your site whose rules might kickin from time to time ... mod_security?

'SoS', Ken


In reply to Ken Task

Re: 503 Service Temporarily Unavailable

by Russell Thomson -
Thanks for replying Ken. I'm confused because I have desktop computer with a single user. I'm not running any automatic processes at all. I have 30 users, so it can't be overloaded and I don't change anything from one backup and update to the next. The only thing I do is add users and quizzes. I don't know if it could be causal but I only started having this problem when I updated from 3.5 to 3.7.
In reply to Russell Thomson

Re: 503 Service Temporarily Unavailable

by Ken Task -
Picture of Particularly helpful Moodlers

'confused' .... uhhhh, yeah, sounds like it.

Let's concentrate efforts on server ... not what you are using (one Windows computer).

Again ... 503 errors are illusive ... meaning there could be different causes ... mostly on server.

Google search:

https://www.google.com/search?client=firefox-b-1-d&q=503+error+nginx

see what I mean? 

So far we have added the problem recently started after an upgrade from 3.5 to 3.7.   Were there any warnings or checks server reported after the upgrade?

Have you checked error logs on the server?

Is cron job completing successfully?

No one in these forums can do a Vulcan Mind Meld with your server so it's up to you, the server administrator, to do some digging.

'SoS', Ken

In reply to Ken Task

Re: 503 Service Temporarily Unavailable

by Russell Thomson -

Hi Ken,

I've attached the error log for yesterday, which was quite bad. Can you help me interpret it?

Regards

In reply to Russell Thomson

Re: 503 Service Temporarily Unavailable

by Ken Task -
Picture of Particularly helpful Moodlers
There are probably two logs for your server ... one is an access log ... the other error log.   Need to check both.
However, from what you've shared so far ...

If your site is using database for sessions, set that to use files.

Also, make sure that ownerships/permissions for your moodledata directory are
at least readable/writable by the user account .... assuming that user is russelleyh.

check configuration of web server ...
In order to get to the moodle one has to add /english/e-learning/ to the URL ... which is doable but sure does make for a long URL.
First time I attempted to access https://site/ like that got a auto forward which didn't complete ... just white screen of death.

Check with hosting providers tutorials/docs about setting up a domain/web server.

'SoS', Ken

In reply to Ken Task

Re: 503 Service Temporarily Unavailable

by Russell Thomson -
Thanks Ken. I contacted the hosting company again and received the following response.
Regarding your question, currently the access to http://www.russell-english.com/english/e-learning/ is working.
Anyways, keep in mind that the databases of the perso/pro hostings have a 30 simultaneos connectins cap, what can create latencies and problems on heavy fraworks like prestashop or moodle.
We suggest you to use a private database instead, which has a 200 simultaneous connections cap.
Regarding your previous answer, I'm afraid I'm out of my depth. I don't understand sessions or files or ownership/permissions in the Moodle directory. The following is a copy of my config.php
<?php // Moodle configuration file unset($CFG); global $CFG; $CFG = new stdClass(); $CFG->dbtype = 'mysqli'; $CFG->dblibrary = 'native'; $CFG->dbhost = 'russelleyhmoodle.mysql.db'; $CFG->dbname = 'russelleyhmoodle'; $CFG->dbuser = 'russelleyhmoodle'; $CFG->dbpass = '******'; $CFG->prefix = 'mdl_'; $CFG->dboptions = array ( 'dbpersist' => 0, 'dbport' => '', 'dbsocket' => '', ); $CFG->wwwroot = 'https://www.russell-english.com/english/e-learning'; $CFG->dataroot = '/home/russelleyh/e-learning/moodledata'; $CFG->admin = 'admin'; $CFG->directorypermissions = 0777; require_once(dirname(__FILE__) . '/lib/setup.php'); // There is no php closing tag in this file, // it is intentional because it prevents trailing whitespace problems! 
  
I've also enclosed the three files you said you needed. 


I don't know if it connected but a week ago I ugraded to SSL and lost all of my links that had previously worked. Maybe I should restore to before the upgrade
Thanks again and regards,
Russell
In reply to Russell Thomson

Re: 503 Service Temporarily Unavailable

by Ken Task -
Picture of Particularly helpful Moodlers

Backup database first ... how you do that on your hosting up to you ... phpmyadmin?

Reason your images/file links 'disappeared' ... moodle uses config.php variable
$CFG->wwwroot to build all internal links in moodle.  You might have changed that alreedy but simply editing config.php file and making that change will not update the database.

If you installed a certificate *after* site was installed, then one needs to run https search and replace.

Search for http://www.russell-english.com/
Replace with https://www.russell-english.com/

Go to:
https://www.russell-english.com/english/e-learning/admin/tool/httpsreplace/

Have no idea what the difference is between perso/pro hosting is.

But 30 simil limit on DB on what you have and what helpdesk response tells you and suggestion move to private database which has 200 simil limit sounds like more than you need as your students don't access site to take a quiz (heavy hitting on DB) at the same time, do they?

What's the max number of students your site has had logged on at one time?

But, guess you'll have to 'trust' them.  Am almost certain the 200 simil limit more than  you really need, but then again, don't manage any servers where you host.

'SoS', Ken