Manually editing the Windows registry to remove invalid Bad Request keys is not recommended unless you are a PC service professional. Mistakes made when editing the registry can lead to inoperability of your PC and cause irreparable damage to your operating system. In fact, even one comma placed in the wrong place can prevent your computer from booting!

Due to this risk, we highly recommend using a trusted registry cleaner such as Reimage (developed by Microsoft Gold Certified Partner) to scan and fix any issues related to Error 400. Using a registry cleaner, you will be able to automate the process of finding damaged registry entries. links to missing files (for example, causing a Bad Request error) and broken links within the registry. Before each scan, a backup, which allows you to undo any changes with one click and protects you from possible damage to your computer. The best part is that eliminating registry errors can dramatically improve system speed and performance.


Warning: Unless you are an experienced PC user, we DO NOT recommend manually editing the Windows Registry. Incorrect use Registry Editor can cause serious problems and require Windows reinstallation. We do not guarantee that problems resulting from incorrect use of Registry Editor can be corrected. You use Registry Editor at your own risk.

Before manually restoring Windows registry, you need to create a backup by exporting the part of the registry associated with Bad Request (for example, Windows Operating System):

  1. Click on the button Begin.
  2. Enter " command" V search bar... DON'T CLICK YET ENTER!
  3. While holding down the keys CTRL-Shift on your keyboard, press ENTER.
  4. A dialog box for access will be displayed.
  5. Click Yes.
  6. The black box opens with a blinking cursor.
  7. Enter " regedit" and press ENTER.
  8. In the Registry Editor, select the Error 400-related key (for example, Windows Operating System) that you want to back up.
  9. On the menu File select Export.
  10. On the list Save to select the folder where you want to save the Windows Operating System key backup.
  11. In the field File name Enter a name for the backup file, for example "Windows Operating System backup".
  12. Make sure the field Export range value selected Selected branch.
  13. Click Save.
  14. The file will be saved with extension .reg.
  15. You now have a backup of your Bad Request-related registry entry.

Next steps when manual editing registry errors will not be described in this article, as they are highly likely to damage your system. If you would like more information about editing the registry manually, please check out the links below.

A 400 Bad Request error occurs when the request sent to the site server is incorrect or corrupted and the server receiving the request cannot understand it. Sometimes the problem arises on the website itself, and you are unlikely to be able to do anything about it. But most of the time the problem is something you can figure out - maybe you typed the address incorrectly, or maybe your browser cache is causing problems. Here are some solutions you can try.

What is a 400 Bad Request error?

The 400 Bad Request error occurs when the server cannot understand the request that has been sent to it. This is called a 400 error because it is the HTTP status code used by the web server to describe such an error.

The 400 Bad Request error can occur due to a simple error in the request. You may have entered the URL incorrectly and for some reason the server is unable to return a 404 error. Or perhaps your web browser is trying to use an expired or invalid cookie. Some servers that are not configured properly may also throw a 400 error instead of more useful errors in some situations. For example, if you try to upload a file that is too large for some sites, you may receive a 400 error instead of an error telling you the maximum file size.

As with 404 and 502 errors, website designers can customize what a 400 error looks like. This way, you may see different 400 error pages on different sites. Websites may also use several different names for this error. For example, you might see things like:

  • 400 Bad Request
  • 400 Bad Request. The request could not be accepted by the server due to incorrect syntax
  • Bad Request - Invalid URL
  • Bad Request. Your browser sent a request that this server could not understand
  • HTTP Error 400: Invalid request hostname
  • Bad Request: error 400
  • HTTP Error 400 - Bad Request

Often you can do something to fix a 400 error, but figuring out what exactly can be difficult due to the vague nature of the error. Here are some things you can try.

Refresh the page

Updating the page is always worth it. Many times the 400 error is temporary and a simple update may help. Most browsers use the F5 key to refresh and also provide a Refresh button somewhere in the address bar. This doesn't often fix the problem, but it only takes a second to complete.

Double check the address

The most common cause of a 400 error is an invalid URL. If you entered the URL into the address bar yourself, you may have made a mistake. If you clicked a link on another web page and received a 404 error, it is also possible that there was a typo in the link. Check the address for any obvious errors. Also, check special characters in the URL, especially those you don't often see in URLs.

Perform a search

If the URL you are trying to find is descriptive (or if you know the approximate title of the article or page you are expecting), you can use keywords in the address to search the website. In the example below, you can't really tell from the URL itself if something is wrong, but you can see some of the words from the article title.

Armed with this knowledge, you can search the website for relevant keywords. This should take you to the correct page.

This same solution also works if the website you are trying to reach has changed the URL for some reason and has not redirected the old address to the new one.

And if a website doesn't have its own search box, you can always use Google (or any other search engine, which you prefer). Simply use the "site:" operator to search only the matching site for the keywords.

In the image below we are using Google and the search phrase "site:site" local network» to search only the site site by keywords.

Clear your browser cookies and cache

Many websites (including Google and YouTube) report a 400 error because the cookies they read are either corrupted or too old. Some browser extensions can also modify your cookies and cause a 400 error. It is also possible that your browser has cached a corrupted version of the page you are trying to open.

To test this feature, you need to clear your browser cache and cookies. Clearing the cache won't affect your browsing experience much, but some websites may take a few extra seconds to load as they re-download all previously cached data. Clearing your cookies means you will have to sign in again to most websites.

Clear your DNS

Your computer may be storing outdated DNS records that are causing errors. Easy cleaning of your DNS records may help solve the problem. It's easy to do and won't cause any problems.

Check the file size

If you upload a file to a website and you get a 400 error, then there is a chance that the file is too large. Try uploading a smaller file to confirm if this causes the problem.

Try other sites

If you try to open one website and get a 400 error, try opening other websites to see if the problem persists. If so, it may be a problem with your computer or network equipment, not the website you are trying to open.

Restart your computer and other hardware

This solution is a hit and rebooting your computer and especially your network equipment (routers, modems) is a common way to get rid of many server errors.

Contact website

If you have tried all the solutions and the error does not disappear, it means that the site itself may have problems. Try contacting the website on the contact page (if that works) or via social media. Chances are they are already aware of the problem and are working to fix it.

When accessing a web server or application, each incoming HTTP request receives an HTTP status code as a response. HTTP status codes are three-digit codes grouped into five different classes. The class of the status code can be determined by the first digit:

  • 1хх – information codes;
  • 2хх – success;
  • 3хх – redirection;
  • 4хх – client error;
  • 5xx – server error.

This guide focuses on identifying and resolving the most common HTTP error codes (i.e. 4xx and 5xx status codes) from a system administrator's perspective. In some situations, the web server responds to a request with a specific error code; let's look at the general possible reasons and solutions.

A quick overview of client and server errors

Client errors (HTTP status codes 400-499) occur due to HTTP requests sent by the client (web browser or other HTTP client). Although these types of errors are related directly to the client, system administrator It is useful to know what error codes a user may encounter to determine if the issue can be resolved in the server configurations.

Server errors (HTTP status codes 500-599) occur when the web server is unable to process a request due to some error or failure.

  • When using a web browser to test a web server, be sure to refresh your browser after making changes to the server settings.
  • Check server logs to get detailed information about how the server processes requests. For example, the Apache and Nginx web servers create two files called access.log and error.log in which you can find relevant information.
  • Remember: HTTP status code definitions are part of a standard that is implemented by the application serving the requests. This means that the actual status code that is returned depends on how software server handles a specific error.

Now that we've become familiar with the basic concepts of HTTP status codes, let's look at the most common errors.

Error 400 Bad Request

Status code 400, or Bad error Request means that the syntax of the HTTP request sent to the server is incorrect.

Typically, the causes of a 400 Bad Request error are:

  • The user's site-related cookies are corrupted. To resolve this issue, try clearing your browser cache and cookies.
  • Malformed request due to faulty browser.
  • Malformed request due to user error when forming an HTTP request manually (for example, incorrect use of curl).

Error 401 Unauthorized

The 401 status code, or Unauthorized error, means that the user trying to access the resource was not authorized (or was unable to complete it by providing incorrect credentials). To be able to view a protected resource, the user must provide valid credentials.

For example, a 401 Unauthorized error can occur if a user tries to access a resource that is protected by HTTP authorization (as in this one). In such a situation, the 401 error will appear again and again until the user provides the correct username and password (which is entered in the .htpasswd file).

Error 403 Forbidden

Status code 403, or Forbidden error, means that the user's request was sent correctly, but the server refuses to serve it due to lack of permission to access the requested resource. This section describes the most common causes of a 403 error.

File permissions

Typically, a 403 error occurs when the user who is running the web server process does not have permission to read the requested file.

To give an example of how to resolve a 403 error, let's assume that:

  • the user is trying to access the index file (http://example.com/index.html);
  • the web server worker process is owned by the user www-data;
  • The index file on the server is located in /usr/share/nginx/html/index.html.

So, if the user receives a 403 Forbidden error, make sure that the www-data user has read permissions on the file. As a rule, in such a situation you just need to change the permissions on the file. This can be done in several ways, but in this case this command will work:

sudo chmod o=r /usr/share/nginx/html/index.html

File.htaccess

Another potential cause of a 403 error (often intentional) is the use of the .htaccess file. Using the .htaccess file, you can deny specific IP addresses (or ranges of addresses) access to certain resources.

If users unexpectedly receive a 403 Forbidden error, make sure that it was not caused by settings in the .htaccess file.

Non-existent index file

If a user tries to access a directory that does not have a standard index file, and directory listing is disabled, the web server will return a 403 Forbidden error. This would happen if, for example, a user tries to access the http://example.com/emptydir/ directory and there is no index file in the emptydir directory on the server. Directory listing can be enabled in server configurations.

Error 404 Not Found

A 404 status code, or Not Found error, means that the user can interact with the server, but the required file or resource is missing.

404 errors can occur in a variety of situations. Below is a list of tips to help resolve the issue if a user unexpectedly receives a 404 Not Found:

  • Check the link that directs the user to the server for errors or typos.
  • The user may have entered an incorrect URL.
  • May be, the desired file does not exist in the specified location on the server; Verify that the requested resource has not been moved or deleted from the server.
  • Check if the location is correct root directory(document root) in the server configuration.
  • It is possible that the user who owns the web server worker process does not have the appropriate rights to open the directory in which the requested file is located. To access the directory you need read and execute permissions.
  • If the user navigates to a resource via a symbolic link, ensure that the web server is configured to support symbolic links.

Error 500 Internal Server Error

Status code 500, or Internal Server Error (“ internal error server") means that the server cannot process the request for an unknown reason. Sometimes this code appears in situations where other 5xx error messages are more appropriate.

Typically, the cause of this error is incorrect server configuration (for example, a malformed .htaccess file) or a lack of certain packages (for example, starting PHP file without PHP pre-installed).

Error 502 Bad Gateway

A 502 status code, or Bad Gateway error, means that the requested server is a gateway or proxy server and is not receiving valid responses from the backend servers that actually made the request.

If it's a reverse proxy (such as a load balancer), make sure that:

  • the backend servers (to which HTTP requests are sent) are fine;
  • the reverse proxy is configured correctly, with the correct backends specified in its settings;
  • network connection between backend servers and reverse proxy is ok. If the servers can communicate on other ports, make sure those ports are not blocked by a firewall;
  • the required sockets exist in the correct location and have the appropriate permissions (if the web application is configured to listen on sockets).

Error 503 Service Unavailable

Status code 503, or Service Unavailable error, means that the server is overloaded or is undergoing maintenance; such a service should become available over some time.

If the server is not in maintenance, this error may indicate that the server does not have enough CPU or memory resources to handle all incoming requests, or that the web server needs to be configured to serve more users or processes.

Error 504 Gateway Timeout

Status code 504, or Gateway Timeout error, means that this server is a gateway or proxy server and it does not receive a response from the backend within the allowed time period.

Typically, this happens for the following reasons:

  • Poor network connection between servers;
  • The back-end server that executes the request is too slow;
  • The server settings have set the gateway or proxy server timeout too short.

Conclusion

You are now familiar with the basic HTTP error codes and some solutions to these problems.

If you encounter an error that was not covered in this article, or know of others convenient ways To resolve HTTP errors, please describe them in the comments below.

Tags: ,

Nowadays, it is difficult to imagine a person who does not use the Internet. Some people get the necessary information from its vast expanses, some enjoy their favorite games, and some even do remote work.

Each of them, at least once, was faced with the fact that upon requesting a certain Internet page an incomprehensible message appeared - "400 - Bad Request."

What does this message mean and why does it appear - regular user doesn't have the slightest idea about this.

In our article we will try to figure out what it is 400 bad request how to fix and how to avoid such a situation in the future.

IN computer world Error 400 (Bad Request) occurs when the server is unable to process the client request. This occurs due to incorrect syntax that creates the necessary relationships between various web services, as well as the client and web applications.

This makes it quite difficult to figure out what's causing this problem, even in a controlled development environment.

On whose side did the error occur?

For those who don't know yet - if the code is 4xx - this is http response data, and errors with such digital values ​​​​occur on the client side.

The client refers to both the browser and the device through which the application is accessed.

At its core, the occurrence of such an error may mean that the client device sent an incorrect request for some reason. This may not only be an incorrectly formed request, but also an attempt. This also includes incorrectly formed http headers, which also cause an error with code 4xx.

Remember that in this case, the object generating the 400-Bad Request error can be either the client or the requested server.

Diagnosing the error

An invalid request error may occur due to one of the following reasons:

  • A false request router accepts information that a client intentionally or accidentally sends. There is a certain category of web applications that try to detect certain headers in a request that certify that there is no malicious intent. If such headers are missing, a 400 error is the inevitable result;
  • If the client device downloads a file that is too large, the request may not be able to complete. This is due to the existing limit on the size of downloaded files on most servers and applications. In this case, you will also encounter the problem described;
  • if the client device requests an incorrectly composed URL, an error warning will also appear;
  • in the process of use by the client, outdated or invalid. This is due to the fact that the browser contains local cookies that identify the session. When two tokens - from your client session and from another client are similar - the requested server may regard this situation as a malicious act and display an invalid request error on the screen.

Solving the client side problem

Be that as it may, the most correct solution would be to find and correct faults in client devices and applications.

The first step is to check the correctness.

Often the error lies in its incorrect input.

Don't forget that domain names - no matter how you type them - will in no way affect correct work links.

For example, internet-company winter group.ru and inTErnet-COmpany grouP.ru will work exactly the same. But everything related to the URL - the information that comes after the domain name - is case sensitive and must be spelled correctly. If the URL contains incorrect characters, the server responds to the request by displaying the error code that occurred.

Clearing cookies

Availability on local server Identical or incorrect cookies are also the cause of the 400 Bad Request error.

These files are small amounts of data that various websites use to remember specific device or the browser from which the request was made.

Thanks to this, all subsequent visits to such a site occur much faster than the first time.

The presence of such cookies creates convenience for the user, but may also cause a conflict with another user's session token. In this case, one of you, and perhaps both of you at the same time, the server will give a 4xx error.

When deleting cookies, you don't have to completely get rid of all existing ones - just delete those that correspond to a specific domain name.

However, if you have no idea about selective deletion, it would be most correct to completely delete.

Each browser has its own cleaning scheme, however, they are all somewhat similar to each other.

Clearing Chrome Browser Cache

  • open the specified browser on your computer;
  • Using the menu icon located in the upper right part of the working window, select the item "Additional Tools", and then - "Clear browsing data";
  • indicate in a special window for what period of time the cleaning should be done;
  • from the list, select the item « Cookies and other site data";
  • click on the button "Delete data".

After these steps, all saved cookies will be deleted from your browser.

Uploading smaller files

If you're downloading a specific file and getting an invalid request error, it may be because the volume is too large.

Try uploading a smaller file to make sure the application works correctly.

Rolling back recent changes

If you updated the client management system before the 400 Bad Request error appeared - The solution to the problem may be to roll back to a previously installed version.

In addition, you can roll back updated extensions and modules, since they can also cause an unpleasant situation.

Removing new extensions and modules

Some extensions have the unpleasant feature of changing tables and records in the database that do not belong to them.

In this case, you will have to delete the latest installed extensions, and then manually clear the database of their effects.

Reinstalling the Windows Operating System program

Incorrect operation of this program may cause a Bad Request. To resolve the issue, you should reinstall it.

Let's look at removing this program using an example.

To do this, follow these steps:

  • use the Start button to open the tab "Programs and Features";
  • open the "Programs" window, the link to which is in the control panel;
  • select item "Programs and Features";
  • in the “Name” section, find the line “Windows Operating System”. Select it and click on the “Delete” button;
  • To complete the removal process, fulfill all the necessary conditions.

After uninstallation, you will need to reinstall this program using the instructions from Microsoft Corporation.

Malware detection and removal

Another reason that can cause a 400 error is that your computer is infected with various .

Such programs can change or completely delete browser state files.

In addition, some components malware may themselves be the cause of the error.

To be able to protect against this type of program, install the appropriate application on your computer. One of the best is Emsisoft Anti-Malware. This application not only protects, but is also guaranteed to remove any malware.

Driver Update

Oddly enough, outdated or incorrectly working drivers can also create a similar problem, so try to check their functionality as often as possible and update them on time.

Manually checking it takes too long, so the easiest way is to install a program on your computer such as DriverDoc, which will completely save you from this routine work.

Windows Update

Microsoft continues to work on updating and improving its operating systems.

In some cases, you just need to update your browser status codes and the Bad Request error will go away on its own.

To do this, you will need to use the “Start” button and enter “update” into the search query, and then press the Enter key.

In this case, the OS update dialog will open, which will display all available packages (if any).

If none of the options helped to get rid of the problem - contact specialists.

Video on solving the 400 Bad Request problem:

Error 400 (Bad Request) is an HTTP response code , which means that the server was unable to process the request sent by the client due to invalid syntax. These HTTP response codes reflect the complex relationships between the client, the web application, the server, and often several third-party web services at once. This can make it difficult to find the cause of an error, even within a controlled development environment.

In this article we will look at what the 400 Bad Request error means (translated as “Invalid request”) and how to fix it

Server side or client side?

All HTTP response codes in the 4xx category are considered client-side errors. Despite this, the appearance of a 4xx error does not necessarily mean that the problem has anything to do with the client, which refers to the web browser or device used to access the application. Often, if you are trying to diagnose a problem with your application, you can immediately ignore most of the client code and components such as HTML, Cascading Style Sheets ( CSS), client-side JavaScript code, etc. This also applies to more than just websites. Many smartphone apps that have a modern user interface are web apps.

On the other hand, a 400 Bad Request error means that the request sent by the client was incorrect for one reason or another. The user client may try to download too big file, the request may be malformed, the HTTP request headers may be incorrect, and so on.

We'll look at some of these scenarios ( and potential solutions) below. But keep in mind: we cannot definitively rule out either the client or the server as the source of the problem. In these cases, the server is the network entity that generates the 400 Bad Request error and returns it as an HTTP response code to the client, but it is possible that the client is responsible for causing the problem.

Start with a thorough application backup

It is important to make a complete backup of your application, database, etc. before making any edits or changes to the system. Even better, it is possible to create a full copy of the application on an additional intermediate server that is not publicly accessible.

This approach will provide a clean testbed in which you can try out all possible scenarios and potential changes to fix an issue without compromising the security or integrity of your live application.

Diagnosis of error 400 Bad Request

Error 400 Bad Request means that the server ( remote computer ) is unable to process a request sent by the client (browser) due to a problem that the server interprets as a client-side problem.

There are many scenarios in which a 400 Bad Request error can appear in an application. Below are some of the most likely cases:

  • The client accidentally (or intentionally) sends information that is intercepted by the false request router. Some web applications look for special HTTP headers to process requests and ensure that the client is not doing anything malicious. If the expected HTTP header is not found or is incorrect, then a 400 Bad Request error is a possible result.
  • The client may be uploading a file that is too large. Most servers or applications have a limit on the size of the downloaded file. This prevents clogging of the channel and other server resources. In many cases, the server will issue a 400 Bad Request error when the file is too large and therefore the request cannot be completed.
  • The client is requesting an invalid URL. If a client sends a request to an invalid URL ( incorrectly composed), this may result in a 400 Bad Request error.
  • The client is using invalid or outdated cookies. This is possible because the local cookie in the browser is a session identifier. If a particular session token matches a request token from another client, then the server/application may interpret this as a malicious act and issue a 400 Bad Request error code.

Fixing client side issues

Error 400 Bad Request ( try again later) it's better to start with a fix on the client side. Here are some tips to try on the browser or device that's giving you the error.

Check the requested URL

The most common cause of the 400 Bad Request error is simply entering an incorrect URL. Domain names (for example, website) are case-insensitive, so a mixed-case reference like this works the same as the normal lowercase version. But the parts of the URL that come after the domain name are case sensitive. Unless the application/server specifically pre-processes all URLs and converts them to lowercase before executing the request.

It is important to check the URL for inappropriate special characters that should not be there. If the server receives an invalid URL, it will respond with a 400 Bad Request error.

Clear relevant cookies

One potential cause of a 400 Bad Request error is invalid or duplicate local cookies. HTTP cookies are small pieces of data stored on the local device that are used by sites and web applications to “remember” a specific browser or device. Most modern web applications use cookies to store browser- or user-specific data, identifying the customer and making future visits faster and easier.

But cookies that store session information about your account or device may conflict with another session token from another user, giving one (or both of you) a 400 Bad Request error.

In most cases, it is sufficient to only consider your application for the cookies that are specific to the site or web application that is throwing the 400 Bad Request error.

Cookies are stored based on the domain name of the web application, so you can delete only those cookies that match the site's domain, leaving other cookies intact. But if you are not familiar with manual removal specific cookies, it is much easier and safer to clear all cookies at once.

It can be done in different ways depending on the browser you are using:

  • Google Chrome;
  • Internet Explorer;
  • Microsoft Edge;
  • Mozilla Firefox;
  • Safari.

Upload a smaller file

If you are receiving a 400 Bad Request error when downloading a file, try to work correctly on a smaller file. This includes "downloads" of files that do not download from your local computer. Even files sent from other computers count as "downloads" from the perspective of the web server running your application.

Sign out and sign in

Try logging out and logging back in. If you have recently cleared your browser cookies, this will automatically log you out the next time you load the page. Just try logging back in to see if the system works correctly.

Also, the application may encounter an issue related to your previous session, which is just a string that the server sends to the client to identify the client on future requests. As with other data, the session token ( or session string) is stored locally on your device in cookies and is transmitted by the client to the server with each request. If the server decides that the session token is invalid or compromised, you may receive a 400 Bad Request error.

In most web applications, logging out and logging back in causes the local session token to be regenerated.

Debugging on common platforms

If you are using common software packages on your server that generate a 400 Bad Request error, examine the stability and functionality of these platforms. The most common content management systems such as WordPress, Joomla! and Drupal, well tested in their basic versions. But once you start changing the PHP extensions they use, it's very easy to cause unexpected problems that result in a 400 Bad Request error.

Rollback recent changes

If you updated your content management system just before the 400 Bad Request error appeared, consider rolling back to the previous version that was installed as the fastest and easiest way remove the 400 bad request error.

Likewise, any extensions or modules that have been updated may cause errors on the server side, so rolling back to previous versions these extensions may also help.

But in some cases, CMSs do not provide the ability to roll back to previous versions. This usually happens with popular platforms, so don't be afraid if you can't find an easy way to get back to using old version one or another software platform.

Remove new extensions, modules or plugins

Depending on the specific CMS that the application uses, the names of these components will vary. But in all systems they serve the same purpose: improving the capabilities of the platform relative to its standard functionality.

However, keep in mind that extensions can somehow gain full control over the system, making changes to the PHP, HTML, CSS, JavaScript or database code. Therefore, a wise decision may be to remove any new extensions that have been recently added.

Check for unintentional changes to the database

Even if you deleted an extension through the CMS control panel, this does not guarantee that the changes it made were completely undone. This applies to many WordPress extensions that are given full access to the database.

An extension can change records in the database that do not "belong" to it, but are created and managed by other extensions ( or even the CMS itself). In such cases, the module may not know how to roll back changes made to database records.

I have personally encountered such cases several times. Therefore, the best way is to open the database and manually view the tables and records that may have been modified by the extension.

Finding problems on the server side

If you are sure that the 400 Bad Request error is not related to the CMS, here are some additional tips that may help find the problem on the server side.