fbpx

As I’m writing this Twitter is down, and it’s actually been down for at least 20 minutes now. It’s hard to tell exactly how long this Twitter outage will last. Since this doesn’t actually happen all that often, I thought I’d profile the site behavior to gather some information on how to detect when Twitter is down so any background processes that connect to it can handle it gracefully.

Twitter is down

In the early days, when Twitter went down the website would display the famed Twitter “Fail Whale”. This actually happened a lot back in those earlier days of the social media platform. When this error image was displayed, the text generally given for the error was “Twitter is over capacity”.

Detect and Handle a Twitter Outage with Azure Logic Apps 1
Twitter “Fail Whale”

Today, on the other hand, was a little different with this much more recent Twitter outage. Often, when a website goes down there may be a “This site can’t be reached” error message of some kind displayed in the web browser. This generally occurs when there’s some kind of DNS (Domain Name System) resolution error with the website and it’s domain name.

Detect and Handle a Twitter Outage with Azure Logic Apps 2
Web Browser “This site can’t be reached” error message

Today’s Twitter outage is a bit different. In general, Twitter outages don’t respond with that kind of message. This current outage displayed a Twitter “Fail Robot” image response with a page stating the following:

Something is technically wrong.
Thanks for noticing – we’re going to fix it up and have things back to normal soon.

Twitter “Fail Robot” error page

The “Fail Robot” image is a bit different that the “Fail Whale” of the old days. The reason for this appears to be a result of a different error message being returned that states “Something is technically wrong.”

Twitter Fail Robot screenshot
Twitter “Fail Robot”

HTTP 500 Error Code

What is the HTTP status code of the Twitter “Fail Robot” error page? As any web develop would expect, the HTTP Status Code for the error is an HTTP 500 “Internal Server Error” response.

HTTP/1.1 500 InternalServerError

This HTTP 500 error is what’s visible and received by any applications attempting to access any pages or APIs at the Twitter.com domain name. I have some automation code that runs against the Twitter APIs that enabled me to see this error first hand. This is the response that is seen by any applications coded against the Twitter APIs, just like the Twitter native mobile app on your smartphone.

I actually have an Azure Logic App in particular that started throwing errors and couldn’t run as it normally would. This time, the errors are the result of the Twitter outage.

Detect and Handle a Twitter Outage with Azure Logic Apps 3
Azure Logic App with a Twitter connector error

In the web browser, there is an HTML response given by the Twitter.com servers. As a result, end-users are being given a more friendly response page with that friendly “Something is technically wrong” error message and the nice Twitter “Fail Robot” image.

There may be times when it’s useful to know what the HTML page response is when Twitter fails with an HTTP 500 error and the Twitter “Fail Robot” imagery. To help you with those scenarios, I’ve captured the following HTML that Twitter used for the error page when accessing the site during the Twitter downtime using a web browser:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="robots" content="noindex, nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Twitter / Error</title>
    <link href="https://abs.twimg.com/favicons/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link rel="stylesheet" href="https://abs.twimg.com/errors/fullscreen_errors-4e29aecc89be6d500979e19c3bd72aa2.css">
  </head>
  <body>
    <div class="errorpage-topbar">
      <div class="errorpage-global-nav">
        <div class="errorpage-global-nav-inner">
          <div class="errorpage-container">
            <ul class="errorpage-nav">
              <li>
                <a href="https://twitter.com"><img class="errorpage-bird" srcset='https://abs.twimg.com/errors/logo23x19.png 1x, https://abs.twimg.com/errors/logo23x19@2x.png 2x' src="https://abs.twimg.com/errors/logo23x19.png" alt="Twitter"></a>
              </li>
            </ul>
            <div class="errorpage-pull-right">
              <ul class="errorpage-nav">
                <li><a href="https://twitter.com" id="homeLink">Home →</a></li>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div>
      <div class="errorpage-body-content">
          <div class="errorpage-canvas">
            <img class= "errorpage-illustration errorpage-robot" src= "https://abs.twimg.com/errors/robot.png" >
          </div>
          <h1 id="title">Something is technically wrong.</h1>
          <p id="desc">Thanks for noticing—we're going to fix it up and have things back to normal soon.</p>
        <div class="errorpage-footer">
          <ul class="errorpage-languages">
              <li><a data-language="ar" data-dir="rtl" href="#">العربية</a></li>
              <li><a data-language="bg" data-dir="ltr" href="#">Български език</a></li>
              <li><a data-language="ca" data-dir="ltr" href="#">Català</a></li>
              <li><a data-language="cs" data-dir="ltr" href="#">Čeština</a></li>
              <li><a data-language="da" data-dir="ltr" href="#">Dansk</a></li>
              <li><a data-language="de" data-dir="ltr" href="#">Deutsch</a></li>
              <li><a data-language="el" data-dir="ltr" href="#">Ελληνικά</a></li>
              <li><a data-language="en" data-dir="" href="#">English</a></li>
              <li><a data-language="en-gb" data-dir="ltr" href="#">English UK</a></li>
              <li><a data-language="es" data-dir="ltr" href="#">Español</a></li>
              <li><a data-language="fa" data-dir="rtl" href="#">فارسی</a></li>
              <li><a data-language="fi" data-dir="ltr" href="#">Suomi</a></li>
              <li><a data-language="fil" data-dir="ltr" href="#">Filipino</a></li>
              <li><a data-language="fr" data-dir="ltr" href="#">Français</a></li>
              <li><a data-language="he" data-dir="rtl" href="#">עִבְרִית</a></li>
              <li><a data-language="hi" data-dir="ltr" href="#">हिन्दी</a></li>
              <li><a data-language="hr" data-dir="ltr" href="#">Hrvatski</a></li>
              <li><a data-language="hu" data-dir="ltr" href="#">Magyar</a></li>
              <li><a data-language="id" data-dir="ltr" href="#">Bahasa Indonesia</a></li>
              <li><a data-language="it" data-dir="ltr" href="#">Italiano</a></li>
              <li><a data-language="ja" data-dir="ltr" href="#">日本語</a></li>
              <li><a data-language="ko" data-dir="ltr" href="#">한국어</a></li>
              <li><a data-language="msa" data-dir="ltr" href="#">Bahasa Melayu</a></li>
              <li><a data-language="nl" data-dir="ltr" href="#">Nederlands</a></li>
              <li><a data-language="no" data-dir="ltr" href="#">Norsk</a></li>
              <li><a data-language="pl" data-dir="ltr" href="#">Polski</a></li>
              <li><a data-language="pt" data-dir="ltr" href="#">Português</a></li>
              <li><a data-language="ro" data-dir="ltr" href="#">Română</a></li>
              <li><a data-language="ru" data-dir="ltr" href="#">Русский</a></li>
              <li><a data-language="sk" data-dir="ltr" href="#">Slovenčina</a></li>
              <li><a data-language="sr" data-dir="ltr" href="#">Српски</a></li>
              <li><a data-language="sv" data-dir="ltr" href="#">Svenska</a></li>
              <li><a data-language="th" data-dir="ltr" href="#">ภาษาไทย</a></li>
              <li><a data-language="tr" data-dir="ltr" href="#">Türkçe</a></li>
              <li><a data-language="uk" data-dir="ltr" href="#">Українська мова</a></li>
              <li><a data-language="vi" data-dir="ltr" href="#">Tiếng Việt</a></li>
              <li><a data-language="zh-cn" data-dir="ltr" href="#">简体中文</a></li>
              <li><a data-language="zh-tw" data-dir="ltr" href="#">繁體中文</a></li>
          </ul>
          <ul>
            <li dir="ltr">© Twitter <span id="copyright-year"></span></li>
            <li><a href="https://about.twitter.com/">About</a></li>
            <li><a href="https://support.twitter.com/">Help Center</a></li>
            <li><a href="http://status.twitter.com/">Status</a></li>
          </ul>
        </div>
      </div>
    </div>
    <script src="https://abs.twimg.com/errors/500-d94f2a77461bc51065438bc297a49586.js"></script>
  </body>
</html>

Handling Twitter is Down Errors

While you generally need to just sit and wait until Twitter service is restored in order to use the service, it’s helpful to add graceful error handling to your applications, background processes, and other code that interacts with the Twitter service.

Graceful error handling is important when any application connecting to a third-party service receives some kind of error. Background processes that are designed well can just log the error and resume where they left off at a later time. However, if there are greater dependencies coded into your applications, it can be important to detect and handle these types of errors.

Using the information in this article, you should be able to better code and/or configure your applications that need to interact with the Twitter.com site and REST API to more gracefully handle any Twitter errors. It can be easy to assume the service “never” goes down, but the fact is that it will and does from time to time.

This is a common behavior with any cloud-based application running on the Internet. As a developer and administrator you need to assume that every service and server will eventually go down. It’s important to take this assumption into account so that system can be designed for greater resiliency to failure, and increase its overall availability and disaster recovery.

Conclusion

Twitter was down as I started writing this article. When I finished writing and ready to publish, it seems that the Twitter service has resumed once again. This type of error doesn’t happen very often, but when it does it can be disrupting to many that rely on the service for communication.

As an IT professional, it’s important that you design your systems to be resilient of this type of error. As a consumer of a communications service like Twitter it can feel “painful” (in a way) when you can’t communicate with those you wish or need to. Be sure that either way, you aren’t too reliant on a service like Twitter, or any other social network, that you can’t function without it.

Happy tweeting, and I hope this information helps you simultaneously understand Twitter and other services like it further, as well as better build and configure your own systems to be more resilient to failure.

Microsoft MVP

Chris Pietschmann is a Microsoft MVP, HashiCorp Ambassador, and Microsoft Certified Trainer (MCT) with 20+ years of experience designing and building Cloud & Enterprise systems. He has worked with companies of all sizes from startups to large enterprises. He has a passion for technology and sharing what he learns with others to help enable them to learn faster and be more productive.
HashiCorp Ambassador Microsoft Certified Trainer (MCT) Microsoft Certified: Azure Solutions Architect

Discover more from Build5Nines

Subscribe now to keep reading and get access to the full archive.

Continue reading