JSON gets cut off after 64 KB

Hey folks,

I’m relatively new to Camunda and I’m working on a project at the moment that is giving me a few headaches.

We’ve got an SpringBoot-application with an Angular frontend that is supposed to take the data to start a process and send them to our Camunda-engine via REST-API. Aside from regular Strings and integer values we also want files (mainly PDF and Word), which are base64-encoded in the Angular-Frontend and can therefore become a bit larger.

The problem is, the variables (including the files) are encoded into JSON and when the size of the JSON surpasses 64 KB, we get an “Unexpected end-of-input in VALUE_STRING”-exception. Our application is encrypted via SSL, if that should make any difference, but I kind of doubt it, because when trying to start a process via the Camunda cockpit Tasklist with the same input parameters (instead of via a REST-call), the whole thing fails as well, when we attach the files. Without the files it is working fine. Did anybody ever encounter something like that?

We are working an Ubuntu and using openJDK 13.0.1 and a PostgreSQL-database.

And here’s the uppermost part of the exception in question:

Unexpected end-of-input in VALUE_STRING
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 65] (through reference chain: org.camunda.bpm.engine.rest.dto.PatchVariablesDto[“modifications”]->java.util.LinkedHashMap[“file_b5b5576b_Object”]->org.camunda.bpm.engine.rest.dto.VariableValueDto[“value”])

Thanks in advance and cheers!

Curious, what version of Camunda are you using? And how are you deploying? I noticed there’s a bug specifically in Tomcat 9.0.31 that looks a lot like this.

We’re using Camunda version 7.12.0. And we’re running a SpringBoot-App via Camunda-Starter with an embedded Tomcat on a Linux-VM. Our Tomcat-version is indeed 9.0.31. Do you know of any way to circumvent that bug?

You’ll need Tomcat to be at least 9.0.33. The simplest thing, honestly, is to go to 7.13 if you can (I believe that’ll get you Tomcat 9.0.36). You could also try overriding just the Tomcat dependency… though it’s hard to say what kind of other trouble any dependency mismatches might get you into.

1 Like

Well, that worked like a charm. Thanks a bunch! :smiley:

2 Likes