Common HTTP errors and how to troubleshoot them
By reading this article, you can learn about different series codes. Also, we will guide you on the ways to troubleshoot some common HTTP errors. These errors include:
i) 400 Series code errors
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 406 Not Acceptable
ii) 500 Series code errors
- 502 Bad Gateway,
- 503 Service Unavailable
- 504 Gateway Timeout
- 508 Resource Limit Reached
Well, now let’s start with errors from
400 Series codes
We consider the status codes in the 400 range to be client error codes. These kinds of error codes are often security-related. Moreover, we can also return the 400 level error codes if the request is malformed OR if the client times out.
1) 400 Bad Request
The 400 status code, or Bad Request error, means the HTTP request that we sent to the server has invalid syntax.
Here are a few examples of when a 400 Bad Request error might occur:
- The user’s cookie that is associated with the site is corrupt. Clearing the browser’s cache and cookies could solve this issue
- Malformed request due to a faulty browser
- Malformed request due to human error when manually forming HTTP requests
2) 401 Unauthorized
The 401 status code, or an Unauthorized error, means that the user trying to access the resource has not been authenticated or has not been authenticated correctly. This means that the user must provide credentials to be able to view the protected resource.
To fix a 401 error, try turning off password protection in cPanel or use the correct username and password.
3) 403 Forbidden
The 403 status code, or a Forbidden error, means that the user made a valid request but the server is refusing to serve the request, due to a lack of permission to access the requested resource. Furthermore, 403 errors commonly occur when the user that is running the web server process does not have sufficient permissions to read the file.
By default, servers display this error instead of a website’s file structure if the browser cannot find the website’s home page.
Index Page Missing:
- The website may be missing the page named index or the index page that we did not upload to the right location.
Index Page Misspelled:
- The website may be missing the page named index or the index page that we did not upload to the right location.
Redirect with no Index Page:
- It’s possible that there is a redirect setup that is stopping the index page from finding properly. If you have set up any redirects via javascript, cPanel, or directly with the .htaccess file, remove and try loading the website again.
Lack of permission to access the requested resource:
- When the user that is running the web server process does not have sufficient permissions to read the file which we are accessing
4) 404 Not Found
The 404 status code, or a Not Found error, means that the user is able to communicate with the server but it is unable to locate the requested file or resource.
404 errors can occur in a large variety of situations. If the user receives an error of 404 Not Found unexpectedly. Here are a few issues to ask during troubleshooting:
- Does the link that directed the user to your server resource have a typo in it?
- Did the user type in the wrong URL?
- Does the file exist in the correct location on the server? Has the user been moving or deleting the resource on the server?
- Does the server configuration have the correct document root location?
- Does the user that owns the web server worker process have privileges to traverse to the directory that the requested file is in? (Hint: directories require read and execute permissions to be accessed)
- Is the resource being accessed a symbolic link? If so, ensure the web server is configured to follow symbolic links
5) 406 Not Acceptable
Web browsers make a request for information from the server. When this happens, it sends an Accept header. This tells the server in what formats the browser can accept the data. If the server cannot send data in a format requested in the Accept header, the server sends the 406 Not Acceptable error. The cause of the 406 error is usually due to a mod_security rule on the server. Mod_security is a security module in the Apache web server that is enabled by default on all hosting accounts.
If you are running into 406 errors and would like Mod_secutiry disabled on your account. Please take note that: when you create a ticket regarding a 406 error, you MUST include information on how our tech support team can reproduce the error as well as your IP address. (click here to find out your IP address easily)
500 Series codes
The 500 status code, or Internal Server Error, means that server cannot process the request for an unknown reason. This most common cause for this error is server misconfiguration (e.g. a malformed .htaccess file). However, the permissions issues, as well as memory usage limits can also cause the error. The content management systems such as WordPress and Joomla can affect memory usage limits.
If you are running into 500 errors, try checking the folders and files permissions, and/or rename the .htaccess file and check the cPanel error log. If these options don’t solve your issue, please submit a support ticket.
1) 502 Bad Gateway
The 502 status code, or Bad Gateway error, means that the server is a gateway or proxy server, and it is not receiving a valid response from the backend servers that should actually fulfill the request. If the server in question is a reverse proxy server, such as a load balancer, here are a few things to check:
- The backend servers (where the HTTP requests are being forwarded to) are healthy
- The user has configured the reverse proxy properly, with the proper backends specified
- The network connection between the backend servers and the reverse proxy server is healthy. If the servers can communicate on other ports, make sure that the firewall is allowing the traffic between them
- If you configure your web application to listen on a socket, ensure that the socket exists in the correct location and that it has the proper permissions
2) 503 Service Unavailable
The 503 status code, or Service Unavailable error, means that the server is overloaded or under maintenance. This error implies that the service should become available at some point. If the user has not been maintaining the server, this may show that the server does not have sufficient CPU or memory resources to manage all incoming applications, or that the web server must be configured to allow more users, threads, or procedures.
3) 504 Gateway Timeout
The 504 status code, or Gateway Timeout error, means that the server is a gateway or proxy server, and it is not receiving a response from the backend servers within the allowed time period. This typically occurs in the following situations:
- The network connection between the servers is poor
- The backend server that is fulfilling the request is too slow, due to poor performance
- The gateway or proxy server’s timeout duration is too short
4) 508 Resource Limit Reached
A 508 Resource error is a result of your site using more than it’s share of server resources. On a shared hosting platform, many domains/websites share the resources of one server. If this is a consistent problem, you could consider upgrading to a VPS hosting plan, which would give you a greater share of resources.
If your website is running on WordPress or another content management system like Joomla!, the CMS may be using too many plug-ins or modules or is using a specific plug-in or module that is employing a lot of resources. For example:
- Some WordPress gallery plugins use enough resources to cause problems.
- Some older WordPress templates incorrectly use a script called timthumb (this script generates thumbnail images on the fly).
- WordPress Multisite will cause problems. It not recommended for use on shared hosting services.
Besides 400 series and 500 series codes, there are some other codes which include:
100, 200, 300 Series codes
HTTP status codes ranging from 100 to 199 are informational codes. If a browser is attempting to access a website and these codes are return, they are normally not displaying onscreen. They are simply internal codes for the browser’s preference.
Status codes ranging from 200 to 299 are success codes. These codes are used internally by the browser as a way of confirming the success and the current status of a request. Although these codes are not normally displayed, there are troubleshooting tools that can read them, and they can be invaluable in the diagnostic process.
Status codes in the 300 to 399 range are redirection codes. They inform the web browser that to meet the application, some other action must be taken. It can be conducted automatically, depending on the nature of this intervention, or it may involve extra user input. For instance, status code 301 shows that a specific web page has been relocated permanently and that all future resource calls should be directed to a separate URL.
Learn about Entry Processes with this article >> What is Entry Processes?