Getting "HTTP/1.1 413 Request Entity Too Large" error in Service Portal...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2020 10:39 AM
I have been working on a Service Portal widget that has to deal with a fair amount of data and I have hit a point were parts of it have stopped working. I am finding that when certain actions are taken I am seeing the client error "HTTP/1.1 413 Request Entity Too Large". Anyone have any thoughts on how to fix it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2020 12:06 PM
Hi
it might be something related to browser cookies:
https://support.mozilla.org/en-US/questions/1180975
Regards
Alberto

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2020 12:41 PM
Interesting, guess my Googling skills need the usual help.
I wonder if the data a widget uses is stored in a cookie when its sent back to the server when you do a server.update(). If it does then that would be the issue because I found a bug in my widget that was loading a few hundred records into a menu that should not have been there. Either way loading less data fixed the issue but it does highlight that my widget will have issues as records build up and I will need to find a way to reduce the amount of data the client loads.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2020 12:59 PM
I don't think this has to do with cookies in your case. Web servers have a maximum request body size set, and when you hit that limit you're going to get this error. If you need to be able to submit a larger request, you would probably need to open a ticket with HI and request a change to the server properties.
As you already noticed, reducing the size of the data object eliminates the problem. Your best bet would be to find ways to only pass essential information back and forth to the server. Perhaps you could use server.get() to pass only essential information back to the server (in the parameters) instead of passing the whole data object back and forth with server.update()?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2020 07:49 AM
I agree Tony. I decided not to try and see if ServiceNow will/can increase the request size because ultimately no matter what they set it to all I am doing is kicking the issue down the road which I do not want to do. Submitting less data with a server.get is one option I have considered and I will need to change a widget design and have people retest the whole thing. Not sure they will let me spend the hours on doing that right now.