Error "Form failure: The context path is either empty or not defined." randomly occurs

Very occasionally, the error message Form failure: The context path is either empty or not defined. occurs when trying to display an embedded form in the Task List after working fine and no changes. Then if I restart the server it is fine again.

image

I am using v7.16.0. Any ideas as to why this is happening? Is there a fix for this at all, because having to restart the server is not ideal!

FYI, it seems that at least one other person has had this before but no answer: https://forum.camunda.io/t/user-task-form-failure-the-context-path-is-either-empty-or-not-defined/26853

Hi Justin,

That question was asked by me but I never got any response. From my analysis I have found out that this issue arises if

  1. We are using a user task form in the bpm process and we try deploying it using the rest api(or from camunda modeler). Which means no restart was done after deploying the bpm process.
  2. We were pointing to the same camunda db from local and dev environment. Ours is a spring boot app with embedded camunda engine. So if we were running the spring boot app from our local environment, it was deploying the bpmn files to the same db instance during server startup. And, then we were getting this context error in our dev environment. Restarting the dev server fixed the issue.

Hope this helps.

1 Like

Thanks for the info. My setup is a single server (Springboot application and a single H2 DB instance), and it can work fine for ages then all of a sudden this happens and required a reboot.

Hello @Justin_Phillips: If it worked after starting the Springboot application and then later it fails, the reason for this error most likely is that you deployed a changed BPMN file to the engine via REST (e.g. via Modeler). In that case the reference to the embedded form in your user task or start event is not found as the form key refers to embedded:app:/path/to/html.
When deploying via REST all resources must be part of this deployment (and the form key needs to refer to embedded:deployment:/htmlfile

Hope that helps!
Best, McAlm

3 Likes

Thank you, that was in fact the problem.

@Prashant_Kala FYI