Encountering the error "INVALID_ARGUMENT: BadScheduleActivityAttributes" in the Temporal workflow

TREAM: streamId=41 errorCode=8 00:22:06.765 [Workflow Executor taskQueue=“approve-promotion-activity-task-queue”, namespace=“default”: 1] ERROR io.temporal.internal.worker.PollerOptions - uncaught exception java.lang.RuntimeException: Failure processing workflow task. WorkflowId=8c1b2052-de5e-471a-a7b8-645f3d6acb7b, RunId=8e238ed1-b654-48ee-ab75-0e4bcb6218b9 at io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.wrapFailure(WorkflowWorker.java:337) at io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.wrapFailure(WorkflowWorker.java:275) at io.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:79) 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:750) Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: BadScheduleActivityAttributes: A valid StartToClose or ScheduleToCloseTimeout is not set on command. at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) at io.temporal.api.workflowservice.v1.WorkflowServiceGrpc$WorkflowServiceBlockingStub.respondWorkflowTaskCompleted(WorkflowServiceGrpc.java:2673) at io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.lambda$sendReply$0(WorkflowWorker.java:369) at io.temporal.internal.common.GrpcRetryer.lambda$retry$0(GrpcRetryer.java:109) at io.temporal.internal.common.GrpcRetryer.retryWithResult(GrpcRetryer.java:127) at io.temporal.internal.common.GrpcRetryer.retry(GrpcRetryer.java:106) at io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.sendReply(WorkflowWorker.java:362) at io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle(WorkflowWorker.java:313) at io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle(WorkflowWorker.java:275) at io.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:73) … 3 common frames omitted

I am trying to implement a promotion approval system for my current project. Can someone assist how to resolve this issue? Their are not errors I can in in my local.

When creating activity stubs, specify the StartToClose timeout using ActivityOptions.

Thanks for replying Maxim but I have already done that
private ApprovePromotionActivities activities = Workflow.newActivityStub(ApprovePromotionActivities.class,
ActivityOptions.newBuilder()
.setStartToCloseTimeout(Duration.ofSeconds(600))
.setTaskQueue(“approve-promotion-activity-task-queue”)
.setRetryOptions(RetryOptions.newBuilder()
.setInitialInterval(Duration.ofSeconds(1))
.setMaximumAttempts(3)
.build())
.build());

Are you sure that this is the only activity stub you are using? You can enable the TRACE level of logging and it is going to emit gRPC requests. Look at the ScheduleActivityTask command to see if it is missing the timeout.