Browsers like Google Chrome will send HTTP requests to server whenever you open a webpage. In the backend, there are useful information sent in the request header as well as received in the response header. However, you will not see all these header information and Chrome will only show the response of the body from the server. During this communication there could be lot of glitches and HTTP error 431 is one such a problem. If you are frequently seeing 431 code in Chrome, here is how to fix the issue.
HTTP Status Code 431
Status code 431 indicates “Request Header Fields Too Large” and the server denied processing the request due this reason. Since all 4xx status codes are due to wrong request from the browser, troubleshooting of 431 error needs to start from analyzing the HTTP request headers sent from Chrome. In addition, there are other possible reasons for 431 error. Try the following fixes and check whether it could help to resolve the issue in Chrome.
Note: Some of these fixes are highly technical and meant for website owners who try to fix 431 HTTP error on their own site.
1. Check HTTP Request Headers Size
Though there are no size limit for the individual and total HTTP header sizes, web servers may reject larger requests due to safety reasons. You can easily check the header size in Chrome Developer Tools to understand whether the size is the root cause.
- Open the webpage in Chrome and you will see “HTTP Error 431”.
- Right-click on the webpage and select “Inspect” option to open Developer Tools.
- Click on “Network” tab and select “All” options to show all the requests sent from the page.
- However, you should refresh the page to start viewing the network activities.
- Right-click on the header row and select “Size” to include that column in the display. You can hide some other columns to make the display compact.
- Now, click on the “Size” column in descending order to find the largest requests in the first few rows.
Generally, each header request should be of few KBs to few hundred KBs in size. If you see very large size request then that could be the reason for 431 error. If you are the website owner, test the site by removing the request from your site or use testing extensions like ModHeader to confirm the problem. If you are not the site owner, then you can inform the site owner through social media accounts and ask for the fix.
2. Delete Browser Cache and Cookies
HTTP 431 error code may also appear when the website uses lengthy cookies. When you are viewing the header request size as explained above, simply click on the name of the document request (this is the page URL and should show as the first item under “Name” column). On the right panel, click “Headers” tab and scroll down to “Request Headers” section. Here you can see the full cookie length requested by the webpage. You can select few requests that you suspect from the left panel and check the cookies sent in those request headers. Though there is a “Cookies” tab showing all the cookies sent from that request, you will not see the full length under that column. You may need to right-click and copy the cookie to paste somewhere and find the full length.
Sometimes, this cookie length can be extremely long and dynamic like when you login to membership websites. The best option is to delete all the cookies in Chrome and check if that helps to fix 431 error. Remember to log out of all other sites before deleting cookies. Otherwise, you will be forcibly logged out as deleting the cookie will lead to session expiry.
- Press, “Control + Shift + Delete” in Windows or “Command + Shift + Delete” in Mac.
- It will open a new tab and show a “Clear Browsing Data” pop-up.
- Go to “Advanced” tab and select “All time” as the time range.
- Check “Cookies and other site data” option and click “Clear data” button to delete all stored cookies in Chrome.
3. Delete Referrer Query Parameters in URL
The next solution is to check the URL in Chrome’s address bar when you receive 431 HTTP error. If the URL is too long then it could be the reason for the error. This happens especially when you click on a link from the current page which tries to open an affiliate page. For example, below is the affiliate page which contains lot of query parameters in the URL for tracking purpose.
https://www.website.com/special/coupon?utm_campaign=affiliate-link_name_username&utm_source=%28direct%29&utm_medium=affiliate&utm_affiliate=123456
If you see the lengthy URL like above, then simply delete all the content in the URL after the ? mark. This will delete the referrer tracking parameters and allow you to access the page without any HTTP error. The final URL in the above case should like simple like – https://www.website.com/special/coupon.
4. Disable All Extensions
Generally, extensions will not cause 431 error in Chrome. However, there could be mistakes while using certain extensions like HTTP header modification extensions. If you have mistaken applied the modifications for the all the sites you visit, then there are chances you get unexpected errors like 431. Check your extensions and add filters to apply the HTTP modifications for only required URLs. Otherwise, simply go to “chrome://extensions/” page and disable all extensions. Now check the pages are loading without any error.
If installed extensions are causing the problem, you may need to enable one by one to narrow down the item that causes the error. Once you find the problematic extension, uninstall it and find another alternative.
Final Words
Cookies and lengthy referral URLs are the most common reasons causing 431 HTTP error in Chrome. However, if you are a website owner or developer testing HTTP headers, then there are lot of possibilities the tool or extension you are using is causing the issue. In such a case, disable all extensions and check the HTTP header size to troubleshoot the problem.
Leave a Reply
Your email is safe with us.