Sling POST servlet HTTP 500 error. POST parameters are being scrambled.
Hello,
We've been trying to troubleshoot an issue with the default sling post servlet and i'm hoping someone has experienced this before. We have javascript on our page that POSTs several nodes/properties when the user clicks a button. For a handful of users (randomly/not very often) when they click the button the server will return a 500 error and based on the logs it appears that the parameters passed in the POST request are being chopped up/spliced. However, when viewing the original request from the browser the parameters look fine. Here is an example of the call (typically ~2020 property/value pairs)
{
"request": {
"method": "POST",
"url": "<SERVERNAME>/content/km/categories/national-billing-issues/209594",
"httpVersion": "HTTP/1.1",
....
"headersSize": 4802,
"bodySize": 240671,
"postData": {
"mimeType": "application/x-www-form-urlencoded; charset=UTF-8",
"text": "jcr%3Acontent%2Fpagecontent%2Fopttabs%2Fcustomer-communication%2Fblockcontent%2FchannelSettings=undefined%3Dselectallchannel%24false&jcr%3Acontent%2Fpagecontent%2Fopttabs%2Fcustomer-commu<ALL PARAMS LISTED IN ONE LINE...>",
"params": [
{
"name": "jcr%3Acontent%2Fpagecontent%2Fopttabs%2Fcustomer-communication%2Fblockcontent%2FchannelSettings",
"value": "undefined%3Dselectallchannel%24false"
},
{
"name": "jcr%3Acontent%2Fpagecontent%2Fopttabs%2Fcustomer-communication%2Fblockcontent%2FchannelSettings",
"value": "Business+%26+Government%3Dbusiness-government%24false"
},
{
"name": "jcr%3Acontent%2Fpagecontent%2Fopttabs%2Fcustomer-communication%2Fblockcontent%2FchannelSettings",
"value": "+B2B+(Gov't+Sales)%3Db2b-governmentsales%24false"
},
.....<SIMILAR PARAMETERS ~2000 TIMES>....
]
}
},
"response": {
"status": 500,
"statusText": "Server Error",
"httpVersion": "HTTP/1.1",
......
And from the server logs we see things like this -
Trying to save an incorrect path that was not in our request (/t/contents instead of /jcr:content/pagecontent):
Trying to save a property with prefix "cjcr":
Parameters spliced to form bad escape sequence:
Trying to save part of a property value as a property name:
The main goal of this post request is to save multi value parameters (channelSettings) to each component on the page with values like (TagTitle%3Dtag-name%24false). It usually works fine except for these one-off issues.
If anyone has any ideas i would appreciate it or even suggestions on how to debug. I haven't been able to find a way to log POST request parameters as they get to the server to see if something is breaking them up before they get to AEM. Currently using 6.3 with SP1
Thanks
