Grow your Business Online​
Wesbytes Blue Logo

Wesbytes Knowledge Base

Search our articles or browse by category below

Common HTTP errors and how to troubleshoot them

Last modified: July 2, 2022
You are here:
Estimated reading time: 5 min

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

400 Series codes

The status codes in the 400-range are regarded as client error codes. These error codes frequently have security implications. In addition, if the request is invalid or the client times out, we can also return the 400 level error codes.

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 user trying to access the resource has either not been authenticated or has not been authenticated successfully, according to the 401 status code, or an Unauthorized error. This indicates that in order to visit the protected resource, the user must enter their credentials.

Try disabling password security in cPanel or entering the proper username and password to resolve a 401 error.

3. 403 Forbidden

The 403 status code, often known as a Forbidden error, indicates that despite the user’s valid request, the server is refusing to fulfil it because they do not have authorization to access the resource. Additionally, 403 errors frequently happen when the user who is in charge of the web server process doesn’t have enough access rights to view the file.

If a browser cannot locate a website’s home page, servers by default show this error rather than the website’s file structure.

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, often known as a Not Found error, indicates that although the user may reach the server, it is unable to find the requested file or resource.

Numerous different circumstances might lead to 404 errors. If a user unintentionally encounters a 404 Not Found error. During troubleshooting, consider the following questions:

  • 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 Acceptale

Web browsers ask the server for data by sending a request. It sends an Accept header in this situation. This lets the server know what file types the browser will accept. The server returns a 406 Not Acceptable error if it is unable to provide data in the format specified in the Accept header. A mod security rule on the server is typically the root cause of the 406 error. All hosting accounts by default have the Apache web server’s security module, Mod security, activated.

If you frequently receive 406 errors and wish to have Mod Security turned off for your account. Please be aware that you MUST include information on how our tech support team can reproduce the mistake as well as your IP address when you file a case reporting a 406 error.

500 Series codes

The internal server error (500 status code) indicates that the server is unable to process the request for an unidentified reason. Server misconfiguration is the most frequent cause of this issue (e.g. a malformed .htaccess file). However, memory use restrictions and problems with permissions can also be to blame for the error. Memory consumption limitations may be impacted by content management systems like WordPress and Joomla.

If you keep getting 500 problems, try verifying the permissions on the files and directories, renaming the.htaccess file, and/or monitoring the cPanel error log. Please open a support ticket if none of these alternatives work to resolve your problem.

1. 502 Bad Gateway

When a server receives a 502 status code, which stands for “bad gateway error,” it signifies that the backend servers that are supposed to process the request are not providing a legitimate answer. Here are a few things to look for if the server in question is a reverse proxy server, like a load balancer:

  • 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 server is overloaded or undergoing maintenance if the 503 status code, or Service Unavailable error, is returned. The service should eventually be accessible, according to this error. If the server has not been maintained by the user, this may indicate that there are insufficient CPU or memory resources on the server to handle all incoming applications, or that the web server needs to be configured to support more users, threads, or processes.

3. 504 Gateway Timeout

The 504 status code, also known as a Gateway Timeout error, indicates that the backend servers are not responding to the gateway or proxy server within the allotted time frame. This frequently happens in the following circumstances:

  • 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

Your website using more server resources than it should is the cause of a 508 Resource error. Many domains/websites share the resources of one server on a shared hosting platform. Consider upgrading to a VPS hosting package, which would give you a larger share of resources, if this is a persistent issue.

If your website is powered by WordPress or another content management system like Joomla!, the CMS may be utilising an excessive number of plug-ins or modules, or it may be utilising a particular plug-in or module that is consuming a significant amount of resources. For instance:

  • 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.

100, 200, 300 Series codes

Informational HTTP status codes fall within the range of 100 to 199. These codes are typically not displayed onscreen when a browser tries to access a website and receives them back. They are only browser preferences’ internal codes.

Success codes fall under the range of 200 to 299 status codes. The browser uses these codes internally to determine whether a request was successful and what its current status is. Despite the fact that these codes are not often visible, there are troubleshooting tools that can read them, and they can be quite helpful when doing a diagnosis.

Redirection codes fall within the range of status codes 300 to 399. They let the web browser know that additional steps are needed to support the application. Depending on the type of intervention, it may be carried out automatically or require more user interaction. For instance, the status code 301 indicates that a certain web page has been permanently moved and that all incoming requests for the resource going forward should go to a different URL.

Was this article helpful?
Dislike 0
Views: 7