Search code examples
javatemporal-workflow

Error while running HelloActivity Sample Temporal Java program


I'm getting the following error when I run the temporal HelloActivity Java sample:

06:43:55.969 [main] INFO  io.temporal.internal.worker.Poller - start(): Poller{options=PollerOptions{maximumPollRateIntervalMilliseconds=1000, maximumPollRatePerSecond=0.0, pollBackoffCoefficient=2.0, pollBackoffInitialInterval=PT0.1S, pollBackoffMaximumInterval=PT1M, pollThreadCount=5, pollThreadNamePrefix='Host Local Workflow Poller'}, identity=23af0cb3-09aa-4cbc-bca2-118cfa79dc96}
06:43:57.291 [Activity Poller taskQueue="HelloActivity", namespace="default": 4] ERROR io.temporal.internal.worker.Poller - Failure in thread Activity Poller taskQueue="HelloActivity", namespace="default": 4
io.grpc.StatusRuntimeException: UNIMPLEMENTED: unknown service temporal.api.workflowservice.v1.WorkflowService
    at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:244)
    at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:225)
    at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:142)
    at io.temporal.api.workflowservice.v1.WorkflowServiceGrpc$WorkflowServiceBlockingStub.pollActivityTaskQueue(WorkflowServiceGrpc.java:2682)
    at io.temporal.internal.worker.ActivityPollTask.poll(ActivityPollTask.java:95)
    at io.temporal.internal.worker.ActivityPollTask.poll(ActivityPollTask.java:38)
    at io.temporal.internal.worker.Poller$PollExecutionTask.run(Poller.java:273)
    at io.temporal.internal.worker.Poller$PollLoopTask.run(Poller.java:242)
    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)

As pre-requisite, docker-compose up was executed and I have all 3 services temporalio/web, temporalio/auto-setup, and cassandra running.


Solution

  • Make sure that you are running the same version of the service as the Java SDK used by the samples requires.

    It looks like the Samples README wasn't updated with the latest version. As of now (7/21/20) the v0.27.0 is the latest version. So tear down the currently running version of the service:

    docker-compose down
    

    then install the latest one:

     curl -L https://github.com/temporalio/temporal/releases/download/v0.27.0/docker.tar.gz | tar -xz --strip-components 1 docker/docker-compose.yml
     docker-compose up