Web

Web Errors | 404, 403, 503, 502, 401 | Meaning and Solutions

Errores Web 404, 403, 503, 502, 401.. Significado y soluciones
Errores Web 404, 403, 503, 502, 401.. Significado y soluciones

In other posts like this one about the error 500 in WordPress, we’ve covered some of the errors you may encounter on various websites and CMS platforms.

Today, we will explain in this post the main errors you might come across with their codes (for example, error 401) and some common solutions.

We’ll summarize all of them in this table:

Common Web Page Errors

Common Web Page Errors

Error Code Description Solution
Error 505 HTTP version not supported Upgrade to a compatible http version
Error 504 The server, acting as a gateway or proxy, did not receive a timely response from the upstream server. This problem is usually due to a very slow upstream server. Optimize the performance of the upstream server.
Error 503 Server unavailable Bugs in plugins and the .htaccess file are usually the usual suspects
Error 502 Unable to access a page Clear cache and test by disabling firewalls
Error 500 Internal server error Many scenarios but usually related to the .htaccess file
Error 429 Too many requests in a given period Implement request limits and rate handling
Error 408 The server timed out waiting for your request Optimize the request to be faster
Error 405 The HTTP method used is not allowed for the requested resource Verify that the HTTP method used in the request is allowed for the resource.
Error 404 Page not found Check the permanent links
Error 403 No permission to access Clear cache and test by disabling firewalls
Error 401 Request requires authentication You will need to unlock access to that URL
Error 400 Invalid request. Usually due to problems in the URL such as strange characters Check URL composition

Error 505

Web Error 505 occurs when the HTTP protocol version used in a request is not supported by the server. This can happen if the client, such as Google Chrome, uses a version of the protocol that the server does not recognize or is not prepared to process.

Common causes of error 505:

Incompatible protocol version: The client may be using an outdated or experimental version of the HTTP protocol that the server does not support.

Server configuration: The server may be configured to reject certain versions of the HTTP protocol. This could be due to security policies or performance optimization.

Possible solutions to error 505:

Update the client:

It’s crucial to ensure that the client is using a version of the HTTP protocol that is compatible. Modern browsers generally support versions like HTTP/1.1 and HTTP/2.

Adjust server settings:

It is advisable to review and adjust the server configuration so that it can process the HTTP version used by clients. If the server is limited to HTTP/1.1 and clients require HTTP/2, it may be necessary to update or modify the server settings to include support for this version.

Error 504

Error 504 – Gateway Timeout occurs when a server acting as a gateway or proxy fails to receive a timely response from the upstream server, where the requested information originates. This means the intermediate server could not get a response from the final server within the expected timeframe.

Common causes of Error 504

Slow or inactive upstream server

The final server may be experiencing high workload, poor configuration, or may be completely offline.

Network connectivity issues

There may be connection difficulties between the gateway server and the upstream server that prevent smooth communication.

Inadequate timeout settings

The time set for the gateway server to wait for a response from the upstream server may be too short.

Some solutions for Error 504 include:

Optimization of the upstream server

It is crucial to ensure that the final server is operational and properly configured to handle the requests it receives.

Adjustment of the timeout setting

Modifying the timeout settings on the gateway server may be necessary to allow more time to receive responses from the upstream server.

Verification of network connectivity

It is important to check for any network issues that could be affecting the data transmission between servers.

Error 503

Error 503 – Service Unavailable occurs when the server is unable to process a request due to a temporary overload or ongoing maintenance. This error is generally temporary and suggests that the server should be operational again after a short period of time.

Common causes of error 503:

Server overload

The server may be experiencing a volume of requests beyond its capacity, preventing it from processing new requests effectively.

Server maintenance

Occasionally, the server may be down for scheduled maintenance, preventing it from responding to requests during that period.

Insufficient resources

The server may lack the necessary resources, such as memory, processing power (CPU), or bandwidth, to handle incoming requests adequately.

Solutions for Error 503 might include:

Scaling server resources

An effective solution is to increase the server’s capacity by adding more memory, more processing power, or more server instances to better handle the load.

Optimizing server performance

Improving the efficiency of the server through code optimization, database queries, and general server settings can significantly enhance its responsiveness.

Configuring maintenance messages

It is advisable to implement messages that inform users about ongoing maintenance, providing details about the estimated duration of the downtime and the reason for it.

Monitoring and load managers

Using monitoring tools to anticipate traffic spikes and employing load managers to distribute requests evenly across multiple servers can prevent this type of error.

Error 502

Error 502 – Bad Gateway occurs when a server acting as a gateway or proxy receives an invalid or incorrect response from the upstream server, i.e., the server being accessed. This error indicates a problem in the communication between the servers involved.

Frequent causes of Error 502:

Communication issues between servers

The upstream server may be offline, overloaded, or improperly configured, preventing a proper response.

Incorrect proxy settings

Mistakes in the intermediary server’s setup can hinder effective communication between servers.

Timeouts

The gateway server may exceed the maximum wait time set to receive a response from the upstream server.

Network problems

Disruptions or failures in network connectivity between servers can also cause this error.

Solutions for Error 502 include:

Verifying the configuration of the upstream server

It’s crucial to ensure the server being accessed is operational and correctly configured to avoid communication issues.

Checking proxy settings

Confirm that the intermediary server’s configuration is correct and error-free to facilitate communication.

Increasing timeout settings

Adjusting the timeout settings in the gateway server’s configuration may be necessary to allow more time to receive adequate responses.

Monitoring

Using network monitoring tools to identify and resolve connectivity issues between servers can help prevent these errors.

Error 429

Error 429 – Too Many Requests occurs when a client sends an excessive number of requests within a specific timeframe. This error helps regulate request rates and protect server resources from overloads or Distributed Denial of Service (DDoS) attacks.

Common causes of Error 429:

Excessive Requests

The client may be sending more requests than the server permits in a specific time frame, exceeding established limits.

DDoS Attacks

A high volume of malicious requests could be targeted at the server with the intent to overwhelm it.

Improper API Use

Applications or scripts that do not properly manage request rates can exacerbate the issue by sending more requests than allowed.

Frequent solutions for Error 429:

Implementing Request Limits

Set rate limits on the server to control the number of requests a client can make in a specific period.

Exponential Backoff

On the client side, implement an exponential backoff mechanism to decrease the frequency of requests after receiving 429 errors, helping to regulate request submission.

Optimizing Requests

Reducing the number of requests sent can be achieved by optimizing the code or consolidating multiple requests into a single more efficient one.

Monitoring and DDoS Protection

Implementing specific monitoring and protection tools can help detect and mitigate potential DDoS attacks, ensuring the server’s stability and security.

Error 408

Error 408 – Request Timeout occurs when the server does not receive the complete request from the client within the established time limit. This means the server could not gather the necessary data in time to process the request.

Common causes of Error 408:

Slow Connection

A slow connection between the client and the server can delay data transmission, causing the request to take too long to complete.

Large Requests

Requests containing large amounts of data may take longer than anticipated, exceeding the server’s configured timeout.

Network Issues

Any disruption or problem in the network can cause significant delays in delivering the request to the server.

Potential fixes for Error 408:

Optimize the Request

Reducing the size of the data sent or segmenting the request into more manageable parts can help it be processed more quickly.

Increase the Timeout

Modifying the server settings to extend the timeout will allow more time for requests to be completed properly.

Improve Network Connection

Ensuring that the connection between the client and server is robust and fast is crucial. Resolving any existing network issues can significantly improve response time.

Check Server Load

It is important to ensure that the server is not overloaded and that it has the necessary resources to handle the requests efficiently within the set time.

Error 404

Error 404 – Not Found occurs when the server fails to find the requested resource. This generally happens when the page or file being accessed does not exist on the server, or has been moved to a different location without updating the corresponding link.

Common causes of Error 404:

Incorrect URL

The web address entered may be incorrect or contain typos, preventing access to the desired resource.

Moved or deleted resources

The requested resource may have been deleted or moved to a different location without proper redirection being established.

Broken links

There may be links within the website that lead to pages or files that are no longer available.

How to solve Error 404:

Verify the URL

It’s important to ensure that the web address entered is correct and typo-free.

Implement redirections

Setting up permanent (301) or temporary (302) redirects can help direct users to the new location of moved resources.

Update internal and external links

It’s crucial to review and update all links on the website to ensure they point to existing resources.

Create a custom 404 error page

Designing an informative and helpful 404 error page can improve user experience by guiding them to other sections of the website such as the homepage or sitemap.

Error 403

Error 403 – Forbidden occurs when the server understands the client’s request but decides not to authorize it. This means access to the requested resource is explicitly forbidden, even though the server is operational and the request itself is valid.

Why does Error 403 happen:

Insufficient permissions

The user or client system does not have the necessary permissions to access the desired resource.

Restricted access

The resource being accessed may be limited due to specific server settings or established access policies.

Errors in the .htaccess file

There may be erroneous settings in the .htaccess file that prevent access to certain resources.

Failed authentication

The server may be requesting additional authentication that has not been provided or is incorrect.

Doing this could solve Error 403:

Verify user permissions

It is crucial to ensure that the user has the appropriate permissions to access the requested resource.

Review server settings

It is essential to review the server and .htaccess file settings to identify and correct any restrictions that should not be present.

Authenticate properly

If the resource requires authentication, providing the necessary credentials and ensuring that the authentication process is carried out correctly is essential.

Clear cache and disable firewalls

Sometimes, temporary issues related to cache or firewall settings may be the cause of the error. Clearing the browser cache and adjusting firewall settings can resolve these issues.

Error 401

Error 401 – Unauthorized occurs when a request made by the client cannot be completed due to a lack of valid authentication credentials for the resource being accessed. This error signifies that authentication is required but has either failed or not been provided.

Common causes of Error 401 include:

Lack of authentication

The client has not supplied any authentication credentials when making the request.

Invalid credentials

The credentials provided by the client are incorrect or have expired.

Access configurations

Access to the requested resource is restricted by configurations that require prior authentication.

Solutions for Error 401:

Provide credentials

Ensure the client provides the correct and necessary credentials to access the desired resource.

Verify authentication

It is crucial to check that the authentication system is operating properly and that the credentials provided are valid and current.

Configure access

Reviewing and adjusting access settings on the server may be necessary to ensure that access is granted with the appropriate credentials.

Update credentials

If the credentials have expired, it is necessary to update or renew them to restore access to the resource.

Error 400

Error 400 – Bad Request occurs when the server cannot process the request sent by the client due to a syntax error or because the request is malformed. This happens because the server cannot understand the request due to incorrect or incomplete data.

Common causes of Error 400:

Incorrect request syntax

The structure of the request may be incorrect or contain syntax errors that prevent proper interpretation.

Malformed URL

The requested URL may include invalid characters or be structured incorrectly.

Invalid input data

The data provided in the request may be incorrect or not meet the format expected by the server.

Excessive request size

The request may be too large for the server to handle efficiently.

Solutions for Error 400:

Review the URL

Ensure the URL is correctly formatted and free of invalid characters.

Correct request syntax

Verify and correct any syntax errors present in the request to ensure it is interpreted correctly by the server.

Validate input data

Confirm that all data sent in the request is correct and in the appropriate format.

Reduce request size

If the request is too large, it may be necessary to divide it into smaller parts to facilitate processing by the server.