Api ошибка 429

When browsing the internet, you might run into various unexpected errors: HTTP 500, HTTP 503, HTTP 403, and — of course — HTTP error 429.

Site owner fixing HTTP Error 429

HTTP error codes such as 429 are a challenge because they often block you from accessing a website. To make sure you understand and can fix this problem, we’ll go over what “HTTP error 429: Too many requests” means and how to fix it.

Download Now: How to Use an API [Free Ebook]

HTTP Error 429 is an HTTP response status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time. Typically, this code will not just tell the client to stop sending requests — it will also specify when they can send another request.

As a website owner, you’ll run into an error message from time to time. Some of these errors will be relatively simple to solve, while others will be more intricate. Take the HTTP error 429 for example.

http 429 error

Image Source

Troubleshooting this error is complicated because it provides few details on what it is or how to solve it. You know something’s wrong and you need to fix it — but you’re not exactly sure what happened or why.

Causes of HTTP Error 429: Too Many Requests

A 429 response is not technically an error — it’s a response from a server, application programming interface (API), or plugin that tells the client application to stop sending requests because they simply don’t have enough resources to accept it at this time.

The client application usually refers to a website or app, but can also refer to individual users like the site admin or a site visitor or hacker.

A 429 error may appear the following ways, with or without the phrase “too many requests”:

  • HTTP error 429

  • HTTP code 429

  • HTTP error code 429

  • HTTP status code 429

  • HTTP response code 429

  • Response code 429

  • 429. That’s an error.

  • 429 server error

  • There was a problem with the server 429

  • Problem with the server 429

Here are some of the potential causes:

Repeated Requests to the Server

A 429 is often triggered by repeated requests. For instance, if a user is trying to access a page on your website too often in a short period of time, your server may send a 429 error.

Any website or app could experience this error, including Facebook, Etsy, Doordash, Venmo, YouTube, PayPal, Airbnb, Google Search Console, and — of course — WordPress websites (more on how to fix WordPress 429 errors below).

Brute-Force Login Attempts

In the case of a brute-force login attempt, in which a hacker repeatedly tries to log into your site, the 429 error code is an important security measure. It sets a rate limit for additional requests, preventing the brute-force attacker from being successful.

Server Resource Limits

You might also get a 429 error if your website is using up too many resources on a shared hosting server or service. If, for example, more than 50 requests are received from an IP address within one minute, PayPal Sandbox will block that IP for the next five minutes.

While the 429 response may seem punitive, it’s actually a protective measure against users intentionally or accidentally abusing server resources (or an API, plugin, or another service). It’s designed to prevent a backup or overflow of requests that would strain a server, or other service, that is meant to be shared and consumed by many websites and apps. So, by controlling the number and timing of requests, rate limits prevent problems before they arise.

If you are seeing the HTTP 429 error on your site for other reasons, you may need to reduce the number of server requests or API calls you’re making.

How to Fix an HTTP 429 Error

  1. Wait to send another request.
  2. Clear your browser’s cache.
  3. Flush your DNS cache.
  4. Implement exponential backoff.

Most of the steps below focus on avoiding, rather than retroactively fixing, an HTTP 429 error. Take a look.

1. Wait to send another request.

The simplest way to fix an HTTP 429 error is to wait to send another request. Often, this status code is sent with a “Retry-after” header that specifies a period of time to wait before sending another request. It may specify only a few seconds or minutes.

Here’s an example that asks the client to wait an hour before sending another request.

 

HTTP/1.1 429 Too Many Requests

Content-Type: text/html

Retry-After: 3600

<html>

<head>

<title>Too Many Requests</title>

</head>

<body>

<h1>Too Many Requests</h1>

<p>Only 100 requests per hour per logged in user is allowed on this website. Try again soon.</p>

</body>

</html>

2. Clear your browser’s cache.

If waiting doesn’t work, try clearing your browser’s cache, which stores your browsing data as well as requests. If you no longer have this data stored in your browser, your next request may go through.

To do so in Chrome:

  • Click CMD + Shift + Delete on Mac or Control + Shift + Delete on Windows.

  • The “Clear browsing data” analog pop up.

  • Click on the Advanced tab.

  • Select the time range and the data you’d like to delete.

  • Click Clear data.

http error 429: clear cache on browser

To find instructions for your specific browser, click here.

3. Flush your DNS cache.

Flushing your DNS cache is another option if clearing your browser’s cache doesn’t work. Your computer’s DNS cache saves your domain name server requests so that it can load websites more quickly the next time you access them. Unfortunately, this may result in HTTP error 429 if you’ve made numerous requests before the DNS cache’s time-to-live naturally expires.

http error 429: flush dns cache

To clear your DNS cache on Mac, take the following steps:

  • “Open Finder.

  • Click Applications.

  • Scroll down to the Utilities folder and click it.

  • Open Terminal.

  • In the Terminal window, enter the following command string: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

  • Click enter, then input your admin password.

  • Click enter again.”

Find instructions for more operating systems here.

4. Implement exponential backoff.

If waiting, clearing your cache, or flushing your DNS cache don’t work, look for a “Retry-after” header again. If one is not sent and you don’t know how long to wait before trying, you should implement retries with exponential backoff.

Using this approach, you will not immediately repeat a failed request; instead, you will perform a series of retries with progressively longer wait times between each attempt. When the request is finally accepted, then you will know what wait time or rate is acceptable.

You can do this manually by using an exponential backoff calculator. Here’s how:

  • Access a calculator such as exponentialbackoffcalculator.com.

  • Input a time interval, such as 2 seconds.

  • Input the maximum number of retries or requests you’d like to make.

  • Input an exponential for subsequent requests.

  • Use a manual alarm or timekeeper to make new requests at the resulting timestamps.

http error 429: use exponential backoff calculator

Alternatively, if you’re a developer or advanced user, you can add code to implement this approach. For instance, you can use a framework like Celery that comes with a built-in exponential backoff module.

Celery comes with built-in exponential backoff feature for fixing the HTTP 429 error

Image Source

The steps discussed above are general fixes for the 429 “Too Many Requests” Error. If you have a WordPress site, then you may need a WordPress-specific solution.

How to Fix HTTP 429 Error on WordPress

If you’re getting an HTTP 429 error on your website, this can pose an issue to you as a WordPress administrator and also hamper your website’s user experience. Here are some tips you can follow:

1. Wait before re-accessing your website.

Your WordPress hosting provider may be receiving too many requests to load your website, resulting in an HTTP 429 error. This is especially likely if you use shared hosting, where your website is only allotted a limited number of resources on the host’s server.

In that case, be patient — the error will resolve on its own. If it keeps happening, however, you might want to upgrade to a dedicated hosting or VPS hosting plan.

You can also try clearing you cache, flushing your DNS cache, and trying exponential backoff during this step.

2. Hide or move your default WordPress login page.

Sometimes, HTTP 429 errors can arise due to cybersecurity attacks such as brute-force attacks on your WordPress login page. You can determine whether you’re under a cybersecurity attack in several ways:

  • Check your traffic sources using a WordPress traffic plugin or a tool such as Google Analytics. If you’re seeing a spike in traffic without a valid reason (such as a marketing or advertising campaign), then you may be under attack.

  • If the traffic source is from an unfamiliar country, that may also be a sign that someone from that location is trying to hack you.

  • If the traffic source is from one specific IP address, that may a sign that a single attacker is trying to login to your backend.

To move your default login page, you only need to change its URL. That can be easily done using the WPS Hide Login plugin.

Here’s how to use it:

  • Install the plugin through your WordPress admin dashboard.

  • Access the plugin’s Settings page.

  • Next to Login URL, add the new slug for your login page.

  • Click Save Changes.

http 429 error: change wp login page slug

Save the new URL somewhere for safekeeping — the last thing you want is to forget where to login!

3. Deactivate your plugins one-by-one.

If you’re still getting HTTP error 429 after waiting, clearing your cache, and checking for brute force attacks, it’s time to look at the next likely culprit: WordPress plugins.

WordPress plugins offer a wealth of functionality to WordPress website owners, but they can also cause performance issues, including HTTP errors such as 429.

Rather than deactivating them all at once, do so one-by-one so that you can isolate the culprit. Here’s how:

  • On your WordPress dashboard’s sidebar, tap Plugins > Installed Plugins.

  • Click Deactivate on the first plugin.

  • Check to see if this resolves the issue by accessing your website through an incognito window.

  • If not, deactivate the next one until all plugins are deactivated.

  • Activate them one-by-one once you’re finished.

http error 429 on wordpress: uninstall plugins

4. Uninstall your custom theme.

If you’re using a custom WordPress theme from a marketplace such as ThemeForest or Envato, that may be the culprit. Make sure you save a backup of your website prior to deactivating the custom theme and temporarily installing a default WordPress theme.

5. Set your own throttling limit for any APIs.

An advanced technique you can try is to set a throttling limit if you’re using APIs on your website. Throttling is the process of limiting the number of requests an application can submit in a given amount of time. If this limit is exceeded, the server or API requests will typically be dropped or fulfilled with cached data.

While this approach is most often used by third-party APIs or platforms to prevent client apps from exceeding their limits, it can also be useful for restricting your own consumption of third-party APIs or server resources.

In fact, you can implement a stricter throttling limit for yourself to prevent going over the limits of a server, API, or other service you’re using. This is an especially good idea if you’re using a costly API, like the Twitter API, and don’t want to exceed your usage policy.

6. Contact your hosting provider.

Contacting your hosting provider is always an option for any error on your website, but it should be one of the last options you try.

If you’ve tried the steps above and are still seeing the 429 error, it’s possible that the cause originated from your server and not your website. It’s also possible that your host blocks requests from specific third-party services or platforms, like Google Search Console, which makes lots of requests to websites. By reaching out to your provider, they may be able to solve the issue or provide valuable insight.

How to Avoid an HTTP 429 Error

The most simple way to avoid this error is to reduce the number of requests made in a short period of time. The server is keeping track of how many requests per time unit you make and will enforce it — leading to a temporary block if exceeded. Some servers send this information in the header, on rare occasions.

And remember, receiving a 429 is not necessarily an error, it’s the server’s way of telling you your rate of requests is too high and not willing to accept those actions.

Though in some instances, the reason for the error may be your server rather than with your website. If that’s the case, nothing you will do from your side will help and you should contact your hosting provider for a resolution.

Resolving the HTTP 429 Error

An HTTP 429 error is common, but can be avoided by paying attention to rate limits set by your server, API, plugin, or more. If you exceed those limits, there are steps you can take to resolve a 429 error. By doing so, you’ll continue to provide visitors with a seamless user experience on your site.

This article was originally published in December 2020 and has been updated for comprehensiveness.

api

What is the “429 too many requests error”?

The “429 Too Many Requests” error occurs when the user or client overwhelms the server with an excessive number of requests within a specific time frame. Additionally, if the web server’s resources are depleted and there is insufficient available memory to process the request, the 429 error occurs.

From the name itself, anyone can understand that the error “429 Too Many Requests” occurs when someone tries to access a website repeatedly and exceeds the allowed number of attempts.

The “429 Too Many Requests” error is one of the most commonly encountered errors in the digital landscape. It occurs frequently and is widely recognized and familiar to web administrators and developers.



Depending upon the browser and customizations, error 429 has too many requests that can be found in different variations. Such as,

  • 429 Too Many Requests
  • 429 Error
  • Response code 429
  • 429 server error
  • HTTP 429
  • Error 429 (Too Many Requests)

HTTP error 429

HTTP error 429

Regardless of the variation, it carries the same meaning, which is that the user or client has overloaded the server with an excessive number of requests within a limited time period.

Most of the time, the error gets resolved by itself. However, in certain conditions such as a Brute force or DDoS attack, it is important to remain vigilant and take immediate action to fix it.


What are the Causes of the 429 Error?

  • Exceeding rate limits or usage quotas: Many APIs and services impose restrictions on the number of requests a client can make in a given time period. If these limits are surpassed, the server responds with a 429 error.
  • Sending excessive requests: Rapidly sending numerous requests to a server, especially within a short duration, can trigger the 429 error as a protective measure against abuse or overloading.
  • Server-side configurations: Some servers are configured to generate a 429 error when certain conditions, such as high traffic or system load, are met.
  • API rate limiting: APIs often implement rate limiting to ensure fair usage and prevent resource exhaustion. If clients exceed the allocated request limits, the API responds with a 429 error.
  • Web scraping and crawling: Automated web scraping tools or aggressive web crawlers can generate an excessive number of requests, overwhelming the server and causing the 429 error.
  • Distributed Denial of Service (DDoS) attacks: Malicious actors orchestrating DDoS attacks flood a server with a massive volume of requests, hindering normal operations and resulting in a 429 error for legitimate users.

Impacts of 429 too many requests error

Impact on User Experience: When a user encounters a 249 error, their first impression may be that the website is unreliable and untrustworthy. This can lead to feelings of frustration and irritation and there will be a sudden drop in web traffic as well.

Potential consequences for Website owners: If error 429 is too frequent, it can lead to dissatisfaction in users, loss of trust, negative brand reputation, and ultimately affect business objectives and revenue.

SEO and SERP ranking considerations: If error 429 is not resolved quickly and continues to persist consistently, it can have a negative impact on your website’s search engine rankings, reduce its visibility, and consequently affect organic traffic.


Read: 🚩 How to improve your WordPress site’s SEO


As mentioned earlier, the “429 Too Many Requests” error message appears when a user sends an unusually high number of requests within a specific time frame. This can occur due to various factors, such as problems with plugins, a potential DDoS attack, or other reasons.

This error is essentially the server’s way of requesting you refrain from sending additional requests.

To resolve this issue in WordPress, you can try one of the eight troubleshooting methods mentioned below:

In this section, you will learn about the best 9 troubleshooting methods to fix the “429 Too Many Requests” error.

  • Clear Browser Cache
  • Flush DNS Cache
  • Check for rate limit by APIs
  • Temporary Disable All WordPress plugins
  • Change the default WordPress Login URL
  • Retry sending request after sometime
  • Try using the default WordPress theme
  • Restore the website from backup
  • Contact your web hosting provider

1. Clear Browser Cache

The browser’s cache plays an important role in improving website loading speed and user experience. When you visit a website, the browser saves various resources such as HTML files, images, CSS stylesheets, JavaScript files, and more into its cache memory.

The next time you visit the same website, instead of fetching all the resources again from the web server, the browser retrieves them from its cache. This reduces the amount of data that needs to be downloaded, resulting in faster page loading times.

However, if the cached data becomes outdated or accumulates excessively, it can lead to the occurrence of “429 Too Many Requests” errors. Therefore, the initial step you should take is to clear your browser cache and check if it resolves the issue.

If you are using Chrome browser, follow the steps given below:


Read: 🚩 Browser Market Share & Usage Statistics


Step 1: Depending on your browser, Go to the settings menu.

In Google Chrome, for example, you can find the settings menu by clicking on the three vertical dots located in the upper right corner of the window.

Step 2: To proceed, select “More tools” and then click on “Clear browsing data”.

Clear browsing data in Chrome

Clear browsing data on Chrome

Step 3: A pop-up window will be displayed, and you can choose all three options located under the “Basic” section as depicted in the picture below. These options consist of “Browsing history,” “Cookies and other site data,” and “Cached images and files.

Step 4: Click on “Clear data” to initiate the process.

Clearing data in Google Chrome

Clearing data in Google Chrome

2. Flush DNS Cache

If clearing your browser cache doesn’t work, you can try flushing your DNS cache. The DNS cache plays a vital role in speeding up website access. It stores recently accessed domain names and their corresponding IP addresses locally on a device. This allows subsequent requests for the same domain to be resolved quickly without querying the DNS server again.

But, if you have made a large number of requests before the DNS cache TTL naturally expires, it can trigger an HTTP error 429.

2.1. For Windows 10 and Windows 11 users:

Step 1: Open the Run command by pressing the Windows key and R. Alternatively, you can search for it in the Start menu.

Step 2: Type “cmd” and hit Enter to open the Command Prompt.

Opening Command Prompt in Windows

Opening Command Prompt in Windows

Step 3: Once the Command Prompt window is open, type “ipconfig/release” to release your current IP address.

Using Ipconfig command on CMD

Ipconfig command on CMD

Step 4: Next, type “ipconfig/flushdns” to release the DNS cache.

Step 5: Type “ipconfig /renew” to obtain a new IP address.

ipconfig renew

ipconfig renew

Step 6: Type “netsh int ip set dns” and hit Enter to reset your IP settings.

Step 7: Finally, type “netsh winsock reset” to restore the Winsock Catalog.

netsh winsock reset

netsh winsock reset

Step 8: After completing these steps, restart your computer to ensure the changes take effect.

2.2. For MacOS users:

Step 1: First of all, open the system preference options on your Mac. If you have Gas Mask installed, it can make searching for system-related tasks easier.

Step 2: Next, navigate to the Ethernet tab and click on the advanced options.

Step 3: Under the TCP/IP tab, you will find the option to release a DHCP lease. Clicking on this option will allow you to clear out the local DNS on your Mac.

Renew DHCP in MacOS

Renew DHCP lease in macOS

Step 4: Go to Utilities > Terminal and enter the command to clear the local DNS cache.

Step 5: The command for flushing the local DNS cache is “dscacheutil -flushcache”.

Step 6: Once you have entered the command, there will be no separate success or failure message that pops up. However, in most cases, the cache will be cleared without any major issues.


3. Check for rate limit by APIs

If you are a developer, you can easily prevent the triggering of 429 errors by having a clear understanding of the specific rate limit set by APIs. It is highly recommended you must check for rate limit document action of APIs.

These rate limits define the maximum number of requests that can be made within a given timeframe. By staying within these allowed thresholds, you can ensure that they do not exceed the limit and trigger the 429 error.

By being aware of the rate limits and managing their requests accordingly, You can maintain a smooth and uninterrupted flow of interactions with the APIs or services, avoiding any disruptions caused by the 429 error.


4. Temporary Disable All WordPress plugins

When attempting to resolve the “429 Too Many Requests” error, it is important to remember the possibility of a faulty WordPress plugin causing conflicts and triggering the issue. Therefore, consider deactivating or disabling all your WordPress plugins as part of the troubleshooting process.

In this case, let us assume you are not able to access your WordPress admin dashboard and are unable to disable the plugin the usual way.

The alternate solution you can do is to try accessing your website via an FTP client i.e. Filezilla and open the wp_content folder.

  1. To do this navigate to public_html/wp-content/ directory.

Too Many Login failed Attempts

wp-content

2. Scroll down to find the wp-content folder. Double Click to open it.

3. Once open the folder, you will see a lot of files with the plugin folder named the security plugin whichever you are using.

4. Select and right-click on the plugin folder for options. Choose Rename and change the name of the plugin. Once the plugin folder name gets changed, WordPress will no longer read it.

5. It is better to rename it as Disabled_plugin.

Once done with everything, save the changes and now you are done.


5. Change the default WordPress Login URL

One common cause of the “429 Too Many Requests” error on WordPress websites is brute-force login attempts. These attempts occur when attackers repeatedly try to gain unauthorized access to your WordPress login page. To protect against such attacks, it’s recommended to change the default login URL.

By default, the login page can be accessed through URLs like yourwebsite.com/wp-admin or yourwebsite.com/wp-login. The problem is that these default URLs are widely known, making it easier for attackers to target your website. However, by changing the login URL to something less obvious and more unique, you can make it harder for malicious individuals to find your login page.

Check out our detailed and dedicated blog post on “WordPress Login URL: How to Find, Modify and Manage It?”.


6. Retry sending request after sometime

To fix an HTTP 429 error, the simplest approach is to give it some time and wait before making another request. When this error occurs, there is often a “Retry-after” header included in the response. It tells you how long you should wait before attempting another request. The waiting period can vary, ranging from a few seconds to several minutes.

For example, let’s say you receive a 429 Too many requests error message asking you to retry after (3600s) or 1 hr.

HTTP/1.1 429 Too Many Requests
Content-type: text/html
Retry-After:3600

So, when you encounter a 429 error, just take a little breather and wait patiently for the specified time mentioned. After the waiting period is over, you can try making the request again without any issues.


7. Try using the default WordPress theme

If you have determined that the installed WordPress plugins are turned out to be okay, there is a possibility that your active theme could be causing issues. This is because a poorly coded WordPress theme can conflict with the plugins and trigger the “429 Too Many Requests” error.

The process is quite similar to manually disabling plugins, as mentioned earlier. The only difference is that you need to navigate to the “public_html/wp-content/themes” directory.

1. Within the themes folder, locate your active theme folder.

2. Right-click on the active theme folder and choose the “Rename” option.

3. Rename the folder with any name you prefer, such as “disable_theme”.

After completing the necessary steps mentioned above, when you try to access your website again, you should no longer encounter the “429 Too Many Requests” error. However, you may notice some differences in the appearance.

But don’t worry, all your customizations and themes will still be preserved.


8. Restore the website from backup

Having a backup of your website is essential as it provides protection against any data loss, malware attacks, accidental website damage, and security breaches. This is the main reason, why we always highly recommend you to back up your website from time to time.

By restoring a site backup, you have the ability to undo any changes that might be causing such as HTTP 429 errors, and restore your website like it was before. It acts as a safety net, ensuring that you can easily recover from any unexpected issues and maintain the smooth operation of your website.

At WPOven, you do not have to worry about backup your website manually. Our Automatic Amazon-based S3 Backup system allows for faster backups and easier downloads.

8.1. How do I restore a backup for my site at WPOven

To restore a backup for your site, you can either :
1) Drop a support ticket and our support team will be happy to restore the backup for you.

OR

2) You can download the desired backup and restore it by logging in through SFTP.


9. Contact your web hosting provider

If the “429 Too Many Requests” error persists despite trying all the troubleshooting methods mentioned above, the final step you can take is to reach out to your web hosting service provider and ask for their support. They can assist in identifying the cause of the error and addressing any underlying issues.


How you can Avoid the 429 Error?

  • Monitoring request volumes and usage patterns: Regularly monitoring request volumes, analyzing usage patterns, and setting appropriate thresholds help maintain compliance with rate limits and prevent the 429 error.
  • Implementing caching mechanisms: Caching frequently requested data or responses reduces the need for repeated requests, minimizing the chances of encountering rate limit restrictions.
  • Using efficient request batching and pagination techniques: Grouping multiple requests into a single batch or implementing pagination techniques can reduce the overall number of requests and mitigate the risk of triggering the 429 error.

Summary

Undoubtedly, encountering any type of error while browsing the web can be irritating and frustrating. However, the silver lining is that certain error codes provide clues about what went wrong and how to approach fixing it.

For instance, the “429 Too Many Requests” error signifies that the server has been overwhelmed by an excessive number of requests. If not resolved promptly, it can disrupt third-party APIs and negatively impact your SEO efforts. Therefore, it is crucial to address this error promptly.

The key to resolving such errors lies in identifying the source of the problem and taking appropriate action accordingly.

Here is an summary on How you can fix 429 too many requests error.

  • Clear Browser Cache
  • Flush DNS Cache
  • Check for rate limit by APIs
  • Temporary Disable All WordPress plugins
  • Change the default WordPress Login URL
  • Retry sending request after sometime
  • Try using the default WordPress theme
  • Restore the website from backup
  • Contact your web hosting provider

If you have any questions about the 429 error or would like to share some tips, please feel free to let us know in the comment section below.


Frequently Asked Questions

How do I get rid of 429 too many requests?

You can easly get rid of 429 too many requests by simply following any of the methods mentioned below :
1. Clear Browser Cache
2. Flush DNS Cache
3. Check for rate limit by APIs
4. Temporary Disable All WordPress plugins
5. Change the default WordPress Login URL
6. Retry sending request after sometime
7. Try using the default WordPress theme
8. Restore the website from backup
9. Contact your web hosting provider

What is 429 too many requests?

The “429 Too Many Requests” error occurs when the user or client overwhelms the server with an excessive number of requests within a specific time frame. Additionally, if the web server’s resources are depleted and there is insufficient available memory to process the request, the 429 error occurs.

What is error 429 in Chrome?

Error 429 in Chrome refers to the “Too Many Requests” error. It occurs when the user sends an excessive number of requests to a website within a certain time frame, exceeding the allowed limit set by the server. This error is a way for the server to ask the user to reduce the frequency of their requests and prevent overwhelming the server.


429 Error – Too Many Requests HTTP Code Explained

Whether you are a web developer or you are a regular internet user, you might have encountered a 429 error. It means that the website can’t handle the number of requests being sent to it.

For a developer, this error can be hard to resolve because, on many occasions, it doesn’t show what you need to do to fix it.
deve-429

But if you’re surfing the net as a user and you encounter the error, there could be a hint showing what to do.
429-clinet

In this case, you should wait a bit to make another request. For security reasons, the period of time to wait might not be specified. But if the website proritzes user experience, they’ll show you how much time to wait before making another request.

In this article, I will explain what the 429 error means and how a developer might have implemented it. I will also show what you can do to resolve it as an internet user.

What is the 429 Error?

The 429 error is an HTTP status code. It tells you when the use of an internet resource has surpassed the number of requests it can send within a given period of time.

This error might be shown to you in another form like:

  • Error 429
  • 429 Too many requests
  • 429 (Too many requests)

It all depends on how the administrator in charge of the internet resource customizes it.

In the small app I built to show you how rate limiting is implemented in an Express app, this is how I customized the error:
custom429

With this error, the administrators in charge of a website or internet resource are telling you they don’t have enough resources to handle the number of requests you are sending over. This is called “rate limiting”.

What Causes the 429 Error?

The most common cause of the 429 error is not having enough resources to handle so many concurrent requests.

For example, if this error is shown on a hosting server, it could mean that the package you’re using has a limit for the number of requests you can send.

And if the error comes up while making an API request, it means you’ve exceeded the number of requests you can make for a certain period of time.

Also, if a user tries to access a page on a website too often, the server of that website could trigger a rate-limiting feature implemented in it. So, this is a good security measure to put in place in order to prevent attacks from hackers.

For example, this is how you can implement rate limiting in an Express app using the express-rate-limit package:

// Import deps
const express = require("express");
const rateLimit = require("express-rate-limit");

const app = express();

// Port
const port = 4000;

const limiter = rateLimit({
  windowMs: 5 * 60 * 1000,
  max: 5, // Limits each IP to 5 per 15 minutes
  message:
    `<h1 style='display:flex; align-items:center; justify-content:center; height:100vh'>
     429 - Too many Requests <br> Try again later!
    </h1>`,
});

// Apply to all requests
app.use(limiter);

app.get("/", limiter, (req, res) => res.send("Hello World!"));

app.listen(port, () => console.log(`App listening on port ${port}!`));

And when the limit is surpassed for the number of seconds specified, this message gets shown to the user:
custom429

What you can do to Resolve the 429 Error

As an internet user, you should wait a bit before making another request. But if the error persists, you should contact the website administrator.

If you’re a web administrator, you should reduce the number of requests you make within the specified time (if any). If you are in control of the limit yourself, you should increase it for a particular period of time.

If the website you’re handling is a WordPress website, one of your plugins or themes might be causing the 429 error. You should disable your site plugins and themes one by one to see which one of them is the cause.

If the error is related to hosting, you should contact the customer care service of your hosting provider.

Conclusion

No website admin wants their server to get clunked up or crash. So, from a technical perspective, the 429 error is not an error. It’s the server’s way of telling you it doesn’t have enough resources to handle the high number of requests you’re making.

Thank you for reading.



Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started

При взаимодействии с веб-ресурсами можно столкнуться с различными проблемами. Одна их таких проблем – ошибка с кодом 429 Too Many Requests. Существует две самые распространенные причины возникновения этой ошибки сервера, с которыми нам предстоит разобраться самостоятельно. 

Причины появления ошибки сервера 429

DDoS-атаки

Начать следует с того, что чаще всего ошибка 429 сопровождается надписью «The user has sent too many requests in a given amount of time», что означает превышение ограничений по запросам к сайту. Соответственно, именно так происходит предотвращение DDoS-атак, которые и являются основной причиной появления рассматриваемой проблемы. Помимо самого кода, вы увидите и несколько других параметров:

  1. Общее количество запросов.

  2. Запросы с конкретного IP-адреса в секунду.

  3. Количество одновременных запросов.

  4. Общее количество запросов с одного IP-адреса.

Если же сама ошибка появляется при использовании поисковых систем или сторонних онлайн-сервисов, которые запрашивают доступ к сайту, вполне возможно, что их блокировка осуществляется со стороны хостинга в связи с тем, что количество запросов превышает ограничение. Для ее решения вам потребуется обратиться напрямую в техническую поддержку с просьбой разрешить подобные запросы.

В случае, когда есть уверенность в том, что ошибка http 429 появилась именно из-за атак на ваш ресурс, советую ознакомиться с отдельным материалом, в котором вы узнаете, как обезопасить себя от DDoS эффективными инструментами и банальными мерами предосторожности.

Подробнее: Способы защиты от DDoS-атаки

Некорректная работа плагинов WordPress

Вторая распространенная причина, которая может быть связана с регулярным появлением неполадки 429, – некорректное функционирование плагинов под управлением CMS WordPress. Для решения этой проблемы потребуется выполнить несколько несложных действий. 

Для начала по очереди отключайте каждый установленный скрипт через меню управления этими компонентами. Параллельно проверяйте, появляется ли ошибка. Да, на выполнение этой задачи может уйти много времени, однако это самый эффективный метод выявления плагина, который является триггером. Отметим, что сразу несколько компонентов могут вызывать проблему, поэтому постарайтесь проверить их все.

Отключение плагинов ВордпрессЧто касается использования плагинов, то тут всегда лучше подключать только проверенные и качественные решения. Со списком таких плагинов предлагаю ознакомиться в материале по следующей ссылке.

Если после проверки неполадка все еще не исчезла, переключитесь на стандартную тему WordPress, которая называется Twenty Seventeen. Это действие поможет понять, связана ли ошибка сервера 429 со скриптами, которые входят в пользовательский шаблон оформления сайта. В том случае, когда трудность действительно была связана с темой, придется переделать ее вручную или же подыскать новый вариант для своего веб-ресурса.

Действия со стороны обычного пользователя

Обычный пользователь, который сталкивается с неполадкой 429 при попытке просмотреть конкретный сайт, не сможет ничего предпринять самостоятельно, чтобы решить ее. Однако, если есть возможность, стоит обратиться напрямую к владельцу интернет-ресурса или администраторам, сообщив им о появившейся ошибке. Так вы дадите понять, что сайт работает не так, как это нужно, и ускорите процесс решения трудностей.

Страница недоступна, ошибка 429

Ошибка HTTP с кодом 429 – неприятная ситуация, которая может коснуться каждого владельца сайта. Из приведенного выше материала вы поняли, что существует две основные причины, которые могут ее вызывать. Теперь остается только разобраться с каждой из них и провести проверочные работы, чтобы оперативно исправить сложившуюся ситуацию.

Как владелец веб-сайта вы время от времени сталкиваетесь с сообщением об ошибке. Некоторые из этих ошибок будет относительно просто исправить, а другие – сложно. Возьмем, к примеру, ошибку HTTP 429.

Что означает ошибка HTTP 429 и как ее исправить

Источник изображения

Устранение этой ошибки затруднено, поскольку она содержит мало подробностей. Вы знаете, что что-то не так, и вам нужно это исправить, но вы не совсем уверены, что произошло и почему.

Чтобы убедиться, что вы понимаете и можете решить эту проблему, мы рассмотрим, что означает ошибка 429 и каковы ее наиболее распространенные решения.

Что такое ошибка HTTP 429?

Ошибка HTTP 429 – это код состояния ответа HTTP, который указывает, что клиентское приложение превысило предел скорости или количество запросов, которые они могут отправить за определенный период времени. Обычно этот код не просто сообщает клиенту о прекращении отправки запросов – он также указывает, когда они могут отправить другой запрос.

Ответ 429 технически не является ошибкой – это ответ сервера, интерфейса прикладного программирования (API) или плагина, который сообщает клиентскому приложению о прекращении отправки запросов, потому что у них просто недостаточно ресурсов для его приема в это время. Клиентское приложение обычно относится к веб-сайту или приложению, но также может относиться к отдельным пользователям, таким как администратор сайта, посетитель сайта или хакер.

Например, если пользователь слишком часто пытается получить доступ к странице на вашем веб-сайте в течение короткого периода времени, ваш сервер может отправить ошибку 429. В случае попытки грубой силы входа в систему, когда хакер неоднократно пытается войти на ваш сайт, ограничение скорости является важной мерой безопасности. Но ограничение скорости также сработает, если ваш сайт использует слишком много ресурсов на сервере или службе общего хостинга. Если, например, с IP-адреса получено более 50 запросов в течение одной минуты, PayPal Sandbox заблокирует этот IP-адрес на следующие пять минут.

Хотя ответ 429 может показаться карательным, на самом деле это защитная мера от пользователей, намеренно или случайно злоупотребляющих ресурсами сервера (или API, плагина или другой службы). Он разработан для предотвращения резервного копирования или переполнения запросов, которые могут перегрузить сервер или другую службу, которая предназначена для совместного использования и использования многими веб-сайтами и приложениями. Таким образом, контролируя количество и время запросов, ограничения скорости предотвращают проблемы до их возникновения.

Если вы видите ошибку HTTP 429 на своем сайте по другим причинам, вам может потребоваться уменьшить количество запросов к серверу или вызовов API, которые вы делаете. Обсуждаемые ниже шаги являются общими исправлениями ошибки 429 Too Many Requests. Если у вас есть сайт WordPress, вам могут потребоваться специальные решения для WordPress.

Как исправить ошибку HTTP 429

  1. Подождите, чтобы отправить еще один запрос.
  2. Реализуйте экспоненциальную отсрочку.
  3. Установите свой собственный предел дросселирования.
  4. Свяжитесь с вашим хостинг-провайдером.

Большинство приведенных ниже шагов направлены на предотвращение, а не на исправление ошибки HTTP 429 задним числом. Взглянуть.

1 Дождитесь отправки другого запроса.

Самый простой способ исправить ошибку HTTP 429 – дождаться отправки другого запроса. Часто этот код состояния отправляется с заголовком «Retry-after», который указывает период времени ожидания перед отправкой другого запроса. Он может указывать всего несколько секунд или минут.

Вот пример, который просит клиента подождать час перед отправкой другого запроса.

HTTP/1.1 429 Too Many Requests
Content-Type: text/html
Retry-After: 3600
<html>
  <head>
    <title>Too Many Requests</title>
  </head>
  <body>
    <h1>Too Many Requests</h1>
    <p>Only 100 requests per hour per logged in user is allowed on this website. Try again soon.</p>
  </body>
</html>

2 Реализуйте экспоненциальный откат.

Если заголовок «Retry-after» не отправляется, и вы не знаете, сколько времени ждать перед попыткой, вам следует реализовать повторные попытки с экспоненциальным откатом. Используя этот подход, ваше приложение не будет немедленно повторять неудавшийся запрос; вместо этого он выполнит серию повторных попыток с постепенно увеличивающимся временем ожидания между каждой попыткой. Когда запрос будет окончательно принят, вы узнаете, какое время или скорость ожидания приемлемы.

Вы можете добавить код для реализации этого подхода или использовать такой инструмент, как Celery, который имеет встроенную функцию экспоненциальной задержки.

Что означает ошибка HTTP 429 и как ее исправить

Источник изображения

3 Установите свой собственный предел дросселирования.

Регулирование – это процесс ограничения количества запросов, которые приложение может отправить за определенный промежуток времени. Если этот предел превышен, запросы к серверу или API обычно отбрасываются или выполняются с кэшированными данными.

Хотя этот подход чаще всего используется сторонними API или платформами для предотвращения превышения клиентскими приложениями своих ограничений, он также может быть полезен для ограничения вашего собственного потребления сторонних API или ресурсов сервера. Фактически, вы можете установить более строгий лимит регулирования для себя, чтобы предотвратить выход за пределы сервера, API или другой службы, которую вы используете. Это особенно хорошая идея, если вы используете дорогостоящий API, например Twitter API, и не хотите выходить за рамки своей политики использования.

4 Свяжитесь с вашим хостинг-провайдером.

Обращение к вашему хостинг-провайдеру – это всегда вариант для любой ошибки на вашем веб-сайте, но это должен быть один из последних вариантов, которые вы пробовали.

Если вы попробовали описанные выше действия и по-прежнему видите ошибку 429, возможно, причина возникла на вашем сервере, а не на вашем веб-сайте. Также возможно, что ваш хост блокирует запросы от определенных сторонних сервисов или платформ, таких как Google Search Console, которая делает множество запросов к веб-сайтам. Обратившись к вашему провайдеру, он может решить проблему или предоставить ценную информацию.

Устранение ошибки HTTP 429

Ошибка HTTP 429 является распространенным явлением, но ее можно избежать, если обратить внимание на ограничения скорости, установленные вашим сервером, API, плагином или другими. Если вы превысите эти ограничения, вы можете предпринять шаги для устранения ошибки 429. Поступая таким образом, вы продолжите предоставлять посетителям удобство работы с вашим сайтом.

Источник записи: https://blog.hubspot.com

Понравилась статья? Поделить с друзьями:
  • Api ошибка 403
  • App module exe системная ошибка
  • App module exe ошибка приложения
  • Api ошибка 200
  • App installation failed with error message ошибка 0x80073d02