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

DrewW
Mega Sage
Mega Sage

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?

4 REPLIES 4

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi @Drew 

it might be something related to browser cookies:

https://support.mozilla.org/en-US/questions/1180975

Regards

Alberto

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.

 

 

Tony DiRienzo
Giga Guru

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()?

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.