Specifying tenant crash rest-api on deployment

Hello,

The API crash when I try to deploy a process and specifying a tenant-id
(with /engine-rest/deployment/create) while without specifying tenant it works.
This crash happens on 7.8.0 my stable release and latest 7.10.0-alpha6.

The message is
“The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException”

(I provide the full stack at the end of the message).

The tenant-id exist and can be seen in cockpit, the process definition is fine (load perfectly without tenant). I have tried to follow the doc on multi-tenancy https://docs.camunda.org/manual/7.5/user-guide/process-engine/multi-tenancy/

That I somewhat adapted:

  • I have 2 engines connected to 2 separates database.
  • I can see them in cockpit.

I probably missed a step, but was expecting something more friendly as an error message to guide me.
for eg I didn’t yet understood If I need to define process-archive or not.

Does anyone have an idea of what went wrong ?

23-Nov-2018 14:08:57.335 SEVERE [http-nio-8080-exec-1] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: null
java.lang.NullPointerException
at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.isResourceHandled(AbstractDefinitionDeployer.java:83)
at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.parseDefinitionResources(AbstractDefinitionDeployer.java:72)
at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:63)
at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:53)
at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:50)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:477)
at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer.deploy(CacheDeployer.java:50)
at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.deploy(DeploymentCache.java:66)
at org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:64)
at org.camunda.bpm.engine.impl.cmd.DeployCmd.deploy(DeployCmd.java:485)
at org.camunda.bpm.engine.impl.cmd.DeployCmd$1.call(DeployCmd.java:141)
at org.camunda.bpm.engine.impl.cmd.DeployCmd$1.call(DeployCmd.java:129)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:477)
at org.camunda.bpm.engine.impl.cmd.DeployCmd.doExecute(DeployCmd.java:129)
at org.camunda.bpm.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:95)
at org.camunda.bpm.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:75)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:27)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:106)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:69)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.RepositoryServiceImpl.deployWithResult(RepositoryServiceImpl.java:101)
at org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl.deployWithResult(DeploymentBuilderImpl.java:269)
at org.camunda.bpm.engine.rest.impl.DeploymentRestServiceImpl.createDeployment(DeploymentRestServiceImpl.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:140)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:103)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:377)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:200)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.camunda.bpm.engine.rest.filter.EmptyBodyFilter.doFilter(EmptyBodyFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

Hi @Yves_Dufournaud,

Can you please provide a script (e.g. using curl) that reproduces the problem? This sounds like a bug in the deployment mechanism or no proper parameter checking in the REST API.

Cheers,
Thorben

Your multipart-form-data should be look like this:

Hello Thorben,

I have since filled a Jira issue since I can reproduce the issue with the latest docker images.

The curl I am using is like tthis:
curl -w “\n” -H “Accept: application/json” -F “deployment-name=reporting” -F “enable-duplicate-filtering=true” -F “deploy-changed-only=true” -F “tenant-id=tenant1” -F “workflow.bpmn=@./reporting/src/main/resources/bpmn/workflow.bpmn” http://localhost:8080/engine-rest/deployment/create

Double checking while answering for feedback: I find a typo in my curl : I was passing “tenand-id” instead of “tenant-id”.
=> this was causing the crash.

Sorry for having bothered you on that. Do I still let the JIRA open ? I renamed it to bad parameter name cause the crash.

Hi @Yves_Dufournaud,

I was able to reproduce this and the JIRA issue remains valid. Thanks for raising it.

Cheers,
Thorben

It is not just a question with tenant-id. It appears that if any of the fields are misspelled then you get a pretty meaningless stacktrace.