This Blog represents how to solve the url too long 414 bad request error.
The first time i encountered this error , when i was working in Sitecore , and there was a Multilist field in Sitecore , and in that field some items were coming in the left side of the field ( pointed by source in the template field ).
I wonder how the left hand side of the data is populated in the field , so i get to know this by checking the logs (search.log) that the query which is generating in the log file that is populating the left side of the field , not the right side .
Example -
4 items were selected in the multilist field for this query.
q=(((((((-_group:(ba88da3f3011494989aa5cff24382eed) *:*) AND (-_group:(e336497360b946b29c038aab661639a5) *:*)) AND (-_group:(f331ec8f888443cabd11463ce0e7c291) *:*)) AND (-_group:(ee60fafc1adb4af3b0d751a2cf6886f6) *:*)) AND ((_path:(2c0df747b00b46cc95a3818a9ac6b491) AND _template:(318e4a01f6614a878e636fe5bace9664)) AND _latestversion:(True))) AND _latestversion:(1)) AND _datasource:(sitecore))&start=0&rows=20&fl=*,score&fq=_indexname:(sitecore_master_index)&wt=xml
In that multilist field i selected a 100 items and still the left side was showing the rest of items , but when i kept on moving the left side items to right side , a moment comes when the left side of the field becomes empty , but eventually it should show the remaining items there.
So after searching on google , found some solutions .
1. Go to the Web.config file of your project and change the maxAllowedContentLength and add maxQueryString , and provide these values .
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000" maxQueryString="1048576" />
</requestFiltering>
</security>
2. Verify the Request filtering feature of your website in IIS .
Go to Request Filtering -> Edit Feature Setting , enter these values if not present.
Then also it does not reflect the sitecore field .
so the last option was the trick.
3. Open the Registry Editory , and go to the Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters
path , and add these parameters with corresponding values.
Max Length of these parameters can be found from Registry Setting For Windows.
This solved the problem for me .
Another similar problem which i faced , was a image was not showing from sitecore , because the file name of that image was too long to handle , so doing all these steps solved my issue.
Note-
Using solr as the search engine in sitecore. For Lucene you won`t face any issue like this.
The first time i encountered this error , when i was working in Sitecore , and there was a Multilist field in Sitecore , and in that field some items were coming in the left side of the field ( pointed by source in the template field ).
I wonder how the left hand side of the data is populated in the field , so i get to know this by checking the logs (search.log) that the query which is generating in the log file that is populating the left side of the field , not the right side .
Example -
4 items were selected in the multilist field for this query.
q=(((((((-_group:(ba88da3f3011494989aa5cff24382eed) *:*) AND (-_group:(e336497360b946b29c038aab661639a5) *:*)) AND (-_group:(f331ec8f888443cabd11463ce0e7c291) *:*)) AND (-_group:(ee60fafc1adb4af3b0d751a2cf6886f6) *:*)) AND ((_path:(2c0df747b00b46cc95a3818a9ac6b491) AND _template:(318e4a01f6614a878e636fe5bace9664)) AND _latestversion:(True))) AND _latestversion:(1)) AND _datasource:(sitecore))&start=0&rows=20&fl=*,score&fq=_indexname:(sitecore_master_index)&wt=xml
In that multilist field i selected a 100 items and still the left side was showing the rest of items , but when i kept on moving the left side items to right side , a moment comes when the left side of the field becomes empty , but eventually it should show the remaining items there.
So after searching on google , found some solutions .
1. Go to the Web.config file of your project and change the maxAllowedContentLength and add maxQueryString , and provide these values .
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000" maxQueryString="1048576" />
</requestFiltering>
</security>
2. Verify the Request filtering feature of your website in IIS .
Go to Request Filtering -> Edit Feature Setting , enter these values if not present.
Then also it does not reflect the sitecore field .
so the last option was the trick.
3. Open the Registry Editory , and go to the Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters
path , and add these parameters with corresponding values.
Max Length of these parameters can be found from Registry Setting For Windows.
This solved the problem for me .
Another similar problem which i faced , was a image was not showing from sitecore , because the file name of that image was too long to handle , so doing all these steps solved my issue.
Note-
Using solr as the search engine in sitecore. For Lucene you won`t face any issue like this.
Comments
Post a Comment