Issue with Document Upload in Moqui: Jackson Error

Hello Moqui community,

I’m encountering an issue while uploading a document to Moqui via the frontend (using Postman or directly in the browser). The error message I receive is as follows:

“Caused by: com.fasterxml.jackson.core.exc.StreamConstraintsException: Document nesting depth (1002) exceeds the maximum allowed (1000, from StreamWriteConstraints.getMaxNestingDepth()).”

The peculiar part is that when I upload the same document through the Moqui screen, I encounter no errors. However, when testing with Postman or the frontend, I consistently get this error.

Here are my observations:

  • The Moqui screen upload works flawlessly.
  • The issue arises only when using external clients (Postman or frontend).
  • I’ve reviewed the document structure, headers, and payload, but I’m still facing this issue.

Could you please provide guidance on how to resolve this discrepancy? Are there any specific Jackson configuration settings I need to adjust for external requests?

Thank you in advance for your assistance!

1 Like

Most likely what is happening is the code to handle the upload is different in internal Moqui screen code vs whatever endpoint you’re calling.

I would recommend looking at the code for the Moqui frontend endpoint (via the browser tools), and try to replicate what the Moqui screen version in the endpoint you are calling from.

I wish I could help more, but I’d need more information about specifically what the Moqui screen endpoint that works, and the structure (and potentially code) that you are calling that doesn’t. If I were to guess, you are uploading a file through a service definition instead of calling code directly inside of a transition.

Hopefully that’s helpful.

1 Like

I’m pleased to inform you that I’ve identified the root cause of the problem and implemented a solution.
Thank you for your assistance : )

1 Like