Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Is there an api call to check if the website is under maintenance?

Mon Nov 23, 2015 6:28 pm

I've noticed the site goes under maintenance often around 8pm CST which is probably prime viewing time for some of my app users. Is there an API call I can make to check if the site is under maintenance so I can tell the users it is under maintenance instead of showing a generic error?

Thanks.

User avatar
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Is there an api call to check if the website is under maintenance?

Tue Nov 24, 2015 8:10 pm

well, not really. The problem is, sometimes we can not handle errors on the way. So in general, show the users the site is under maintenance, or temporary problem, so they can try later.

MarcoTC
Subtitles Admin
Posts: 44
Joined: Sat Jun 13, 2015 5:15 am

Re: Is there an api call to check if the website is under maintenance?

Thu Nov 26, 2015 8:53 am

You should get response code 503 when doing the login.

User avatar
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Is there an api call to check if the website is under maintenance?

Thu Nov 26, 2015 10:37 am

sure, check for http response codes, if from 5xx family, it is down...

mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Re: Is there an api call to check if the website is under maintenance?

Thu Nov 26, 2015 3:29 pm

Good idea, that makes sense.


User avatar
vankasteelj
Posts: 175
Joined: Sun Nov 15, 2015 1:09 am

Re: Is there an api call to check if the website is under maintenance?

Fri Nov 27, 2015 3:18 am

But, 503 happens too when not on maintainence, but only heavy load. I've encounered 503 codes that were resolved if I retried the call.

User avatar
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Is there an api call to check if the website is under maintenance?

Fri Nov 27, 2015 5:26 am

But, 503 happens too when not on maintainence, but only heavy load. I've encounered 503 codes that were resolved if I retried the call.
this is true. Maybe correct would be retry request in 1 second three times, and then show msg to user to try later.

MarcoTC
Subtitles Admin
Posts: 44
Joined: Sat Jun 13, 2015 5:15 am

Re: Is there an api call to check if the website is under maintenance?

Fri Nov 27, 2015 8:12 am

You can check the 503 description string.

mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Re: Is there an api call to check if the website is under maintenance?

Fri Nov 27, 2015 5:10 pm

What is the 503 description when the site is undergoing maintenance?

User avatar
vankasteelj
Posts: 175
Joined: Sun Nov 15, 2015 1:09 am

Re: Is there an api call to check if the website is under maintenance?

Sat Nov 28, 2015 3:04 am

Well I don't know what it IS, but I know what it's NOT:

"Guru Meditation" should be displayed in html's body when it's a crash

User avatar
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Is there an api call to check if the website is under maintenance?

Sat Nov 28, 2015 8:03 am

503 guru meditation is classic varnish error, when there is some real big problem, such as restarting server, error in code, high load etc. I can not really control it.

But the thing is, I can add in xml-rpc some message when site is down for maintenance (it doesn't mean you will not get these 503 errors)

User avatar
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Is there an api call to check if the website is under maintenance?

Sat Nov 28, 2015 8:29 am

I added new status for xml-rpc '506 Server under maintenance',

Code: Select all

<?xml version="1.0"?> <methodResponse> <params> <param> <value> <struct> <member> <name>status</name> <value><string>506 Server under maintenance</string></value> </member> </struct> </value> </param> </params> </methodResponse>
it will come together with http 503 status code.

mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Re: Is there an api call to check if the website is under maintenance?

Sat Nov 28, 2015 4:16 pm

Thank you so much, that is very helpful.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 23 guests