Understand the error you are getting

Disclaimer and motivation

This is not an IT technical article. This is not an article for IT professionals. This an article for all internet users. The intention of this post is that anyone can understand at a high level, what the error codes and messages we are presented when browsing the Internet are telling us.

My target is to help you to answer a very important question: can I do anything to fix it or not?

This is the same question I would love to be able to answer myself when facing issues with my car. I’m not. 😀 But, believe me, you can really answer this when browsing the web. 🙂

HTTP status codes

Most probably, if you are not totally new to browsing the Web, you should be familiar with the famous: “404 Page not found” message. This “404” is not a random error number or message. “404” is one very specific error code. More specifically, “404” is an HTTP status code.

Full list of the HTTP codes can be checked at Wikipedia.

When you want to visit a page, what you are doing (in a simplified way) is requesting data/files to a server. For instance, when I type “https://www.isinternetworking.com” and press enter in the address bar of my Internet browser, my browser is locating the server who contains this site and requesting the server for the needed files. HTTP status codes are the responses the server are providing to these clients (the web browser in this case). If you want to know more in details how the Internet works, please check here.

If you are facing issues reaching a site or getting a web application to work properly, HTTP status codes provide valuable information and some clues about what can be happening.

As a quick summary:

  • 1xx codes are information codes. They typically mean that request have been understood and some partial tasks have been successfully completed.
  • 2xx codes mean Success. “200” is the most common success code. It means: “All understood, here you have”.
  • 3xx codes mean Redirection. They mean: “the request you sent is being redirected to someone else or to somewhere else”.
  • 4xx codes mean Problems. But problems from the client-side. The server is telling you: “It’s not I’m not working properly. It’s you who are not asking things properly.” Some of them can help a lot to troubleshoot issues, you should be familiar with:
    • 400: typically a malformed request
    • 401: unauthorised request.
    • 403: forbidden. You can not access. The difference between 401 and 403 is that when you get a 401 means the server doesn’t know who you are (wrong credentials or not provided) and when you get a 403 it means: “I know who you are, and no, you can not access this.”
    • 404: not found. A most common example is when requesting a non-existing page (don’t forget to check for typos :-)).
    • 408: time out. Remember, we are talking of client-side errors, so basically, it means the server was waiting for something from the client and it was not provided in time.
  • 5xx codes mean Problems again. But now, we are talking about server-side problems. You should be familiar with:
    • 500: generic error
    • 501: your request was not understood by the server or not implemented.
    • 503: the server could not manage your request. But in this case, it should be a temporary error (due to temporal unavailability of the server due to heavy load, maintenance…).

How to check HTTP status codes

Sometimes, these codes will be presented to you directly in the browser. Most common cases:

First important thing to note down:

  • If a 4xx, maybe you can do something on your side. As this is a client-side issue, maybe you have the wrong address or the page has been moved and you can search for the new location.
  • If a 5xx, in general, nothing to do on your side. Something is wrong with the servers. You can contact the service provider, the site owners or administrators if those are options are available and possible for you. You can try later. But in summary, something is wrong with the site, someone else has to fix it.

And, what can you do if you are not being presented with an HTTP status code? There is a very powerful tool right available for you that it’s included with most of the web browsers: the developer tools.

  1. Go to your Internet browser and just press “F12” in your keyboard (this works for Chrome, Firefox, Edge and Internet Explorer).
  2. Developer tools will open in your browser.
  3. Refresh the page you are having issues with. Developer tools will monitor and collect detailed information and traces about what is happening.
  4. Out of all the options available, I would recommend you to check these 2 at least:
    • Console: here you will find server responses. You can filter by errors and in many cases, you will find meaningful information. For example, I remember a site where the embedded maps were not being displayed. When checking the console, I could see a message from Google Maps services responding: “your API key is not authorised to access this service”. Even if you don’t know what an API is, what you can guess is that the site is calling Google Maps services to get the map and Google is telling the site: “nop, you can not”. Something is wrong with the site. It’s nothing you can do on your side.
    • Network: here you will find a list of all the data sources and files the web browser is trying to get and the HTTP status code for each one. You will be able to see for example if a data source (an image, a data table) was not reached and its corresponding error code.

As a very simple but practical example, you can try to navigate again to https://www.isinternetworking.com/what-is-happening-on-the-interneSSS but now with the Developer Tools in your browser enabled. If you click on “Console” you will see something like this:

You will see the 404 HTTP status code there! 🙂

In this case, this site has a customised page to translate for our users this “404” to plain English: “Oops! That page can’t be found.” Most sites on the Internet will have something similar because, in the end, we all want our users to understand what is happening. But sometimes, you will see just a number with a very short text that probably won’t tell you much; or even worse, you will see just a blank pages, buttons or components not working and nothing apparently happening.

Hope this post helped you to understand a bit more about the error codes and messages you get.

As I said at the beginning, the most important thing for me is to be able to identify if I’m doing something wrongly and I can fix it or do it differently; or if there is nothing I can do apart from notifying and/or waiting. Remember the Serenity Prayer! 🙂

God, grant me the serenity to accept the things I cannot change,

courage to change the things I can,

and wisdom to know the difference

If you liked this and you want more, please check my article Understand how the Internet works.