[ColdBox 3.7.0] Is there a max size limit in request payload?

I have an app that need to output some data that I post trough an api.

I noticed that when the data are small size coldbox can output the data correctly, but if the size length is bigger I got this error:

`

Railo 4.1.1.000 Error (java.lang.StackOverflowError)
Message java.lang.StackOverflowError
Cause java.lang.StackOverflowError
Java Stacktrace java.lang.StackOverflowError
at java.lang.StringBuilder.append(Unknown Source):-1
at railo.runtime.dump.DumpUtil.toDumpData(DumpUtil.java:186):186
at railo.runtime.type.util.StructUtil.toDumpTable(StructUtil.java:118):118
at railo.runtime.type.util.StructSupport.toDumpData(StructSupport.java:125):125
at railo.runtime.type.CastableStruct.toDumpData(CastableStruct.java:129):129
at railo.runtime.dump.DumpUtil.toDumpData(DumpUtil.java:199):199
at railo.runtime.type.util.StructUtil.toDumpTable(StructUtil.java:118):118
at railo.runtime.type.util.StructSupport.toDumpData(StructSupport.java:125):125
at railo.runtime.type.CastableStruct.toDumpData(CastableStruct.java:129):129
at railo.runtime.dump.DumpUtil.toDumpData(DumpUtil.java:199):199
at railo.runtime.type.util.StructUtil.toDumpTable(StructUtil.java:118):118
at railo.runtime.type.util.StructSupport.toDumpData(StructSupport.java:125):125
at railo.runtime.type.CastableStruct.toDumpData(CastableStruct.java:129):129
at railo.runtime.dump.DumpUtil.toDumpData(DumpUtil.java:199):199
at railo.runtime.type.util.StructUtil.toDumpTable(StructUtil.java:118):118
at railo.runtime.type.util.StructSupport.toDumpData(StructSupport.java:125):125

`

This error does not happen if I send small amount of data.

I send this data with POST and then output like this:

`

<cfif len(httpContent.content) gt 0>

`

I’m on railo 4. This error does not happen if I try the same script on a stand alone page, always on same server. So I tend to consider this is a coldbox issue.

Hi,

I have increased the memory limit, but still get the error. Or my data are too big or there is another problem…

The strange thing is that on the same server the request causes no problem if I run that script out of coldbox. So how much memory coldbox need?

Looking at the error; are you trying to dump something with circular references?

I’m trying to simply output the content of the post request, as in the script I posted before.

If I post small amount of data, it works properly, with greater amount of data the script give me the error.

I could also post here the content of my http request, so that you could chek, but it’s almost 30000 rows…

Also related, is any of the debugging / reporting tools in ColdBox turned on that again, would maybe try to dump circular references?

No. I have disabled all debug information. I think that circular reference is generated by coldbox that try to output the line of the error, but it runs out of memory because the data I pass are too big.

If I set a custom error template, that page simply display my error page.

Making a small data request, the scripts give me no error.

So that tells me that coldbox cannot handle large amount of data in the http request body. I will post my data here, if you wanna make some test.

I’ve attached my request content. Would be great if someone could make some test…

(Attachment myRequest.txt is missing)

To make a test, I’ve used a fresh coldbox app. Created a simple handler

`

function index(event,rc,prc){
writeDump(var="#GetHTTPRequestData()#",label="");abort;
}

`

I’ve used postman chrome extension and copy/pasted the content of the file to create a request to that handler. If I remove 20000 rows, the script works. Without eliminate rows, the script gives that error.

So coldbox should have a limit on request max size. I suppose.

Nothing I see with your code deals with CB directly, other then it being inside an event handler.

I just read the file and dumped it without issue; can you do the same?
If yes, then are you sure it’s not a problem with getRequestData?

This is the test I just ran

(Too many singular replies, sorry)

First, I don’t think ColdBox has any type of POST size limit. The only place I know that has something like this is in CF-Admin (or Railo) which limits it.
Nothing in you’re code or error shows that ColdBox might be the cause, but as you say; it works outside of CB.
Event if CB duplicated the http request body into the RC or PRC, I’m still not sure that would cause a StackOverflow issue.
Not to mention the n* calls to railo.runtime.dump.DumpUtil.toDumpData - I am still pretty sure there is a reporting / debugging tool running that is causing your error.

I'm sure i have no debugging tool enabled. As i said before, that dumping is caused by coldbox error stackoverflow. If I enable the custom error handler, that error disappear and coldbox output correvtly the custom error page without outputting any information. But this is not the problem. The problem is that page cannot parse large request data. Luis probably could help

I have created the same test as Don, and it works without problem. So this means that the problem should be in GetHTTPRequestData() method.

After a lot of test, I supose that coldbox fail to parse that data file.

I cannot say why it cannot correctly parse the data I send, probably this is due to the way coldbox generate the request context.

So how can I send data to coldbox to generate inline pdf?

Have you thought about looking into the renderData() option?

http://wiki.coldbox.org/wiki/EventHandlers.cfm

About half way down will show that ColdBox already does this for you.

Yes, renderdata definetely solve my problem. Thanks!!

Yeah I think the problem is that in your handler, it was wrapping the PDF inside the layout. Which ColdFusion and Railo will complain about.

Sorry to said this is not a solution.

With big file the pdf is not generated. I really don’t understand what’s the problem I’m sure that coldbox is injecting something in the views that break my pdf…

This only works with small data.

I’m sure this is due to getHttprequestdata() size limit…