Exception while trying to completeActivity exceptionally

I am trying to complete activity exceptionally.
Below is my code snippet-

    WorkflowClient workflowClient = WorkflowClient.newInstance(host, port, DOMAIN);

                ActivityCompletionClient completionClient = workflowClient.newActivityCompletionClient();
                WorkflowExecution workflowExecution = new WorkflowExecution();
                workflowExecution.setRunId(graphiteQueryWrapper.getWorkflowMetadata().getRunId());
                workflowExecution.setWorkflowId(graphiteQueryWrapper.getWorkflowMetadata().getWorkflowId());
                try {
                    completionClient.completeExceptionally(workflowExecution, graphiteQueryWrapper.getWorkflowMetadata().getActivityId(),ex);
                } catch (ActivityCompletionException e) {
                    logger.error("Error completing storeMetrics activity" + e.getMessage());
                    e.printStackTrace();
                }

However, I am getting exception while closing activity exceptionally.

    com.uber.cadence.client.ActivityCompletionFailureException: ActivityId28
    	at com.uber.cadence.internal.external.ManualActivityCompletionClientImpl.fail(ManualActivityCompletionClientImpl.java:162)
    	at com.uber.cadence.internal.sync.ActivityCompletionClientImpl.completeExceptionally(ActivityCompletionClientImpl.java:52)
    	at com.ea.reporter.workers.graphite.GraphiteWorkflowImpl.storeGraphiteMetrics(GraphiteWorkflowImpl.java:50)
    	at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.uber.cadence.internal.sync.POJOWorkflowImplementationFactory$POJOWorkflowImplementation.execute(POJOWorkflowImplementationFactory.java:244)
    	at com.uber.cadence.internal.sync.WorkflowRunnable.run(WorkflowRunnable.java:47)
    	at com.uber.cadence.internal.sync.CancellationScopeImpl.run(CancellationScopeImpl.java:102)
    	at com.uber.cadence.internal.sync.WorkflowThreadImpl$RunnableWrapper.run(WorkflowThreadImpl.java:99)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: BadRequestError(message:ActivityID is not set on request.)
    	at com.uber.cadence.WorkflowService$RespondActivityTaskFailedByID_result$RespondActivityTaskFailedByID_resultStandardScheme.read(WorkflowService.java:28913)
    	at com.uber.cadence.WorkflowService$RespondActivityTaskFailedByID_result$RespondActivityTaskFailedByID_resultStandardScheme.read(WorkflowService.java:28899)
    	at com.uber.cadence.WorkflowService$RespondActivityTaskFailedByID_result.read(WorkflowService.java:28809)

Can someone please help?

The root cause is “message:ActivityID is not set on request”. It looks like you are passing an empty ID to the completeExceptinally call.

Hi Maxim,
com.uber.cadence.client.ActivityCompletionFailureException: ActivityId28
I am trying to print ex.getMessage() and it is printing appropriate activity id as seen in the above trace.
Is there anything else I am missing?

Try reproducing it using this Cadence sample. If reproducible file an issue.

I changed the similar temporal sample to use complete and complete exceptionally by Id and it worked fine.

okay thanks Maxim…I checked in cadence and it is failing.
I will file an issue on the github repo.
Thanks for the help.