temporalio / temporalio/cli

[Bug] Worker deployment delete error

Open
#813 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
379
Forks
103
Avg merge
2d 11h
Merged PRs (30d)
23

Description

What are you really trying to do?

I created a worker deployment / associated version to test out the functionality. I would now like to delete that deployment and effectively un-version the worker.

Describe the bug

When running the command temporal worker deployment delete --name I'm receiving an error

Minimal Reproduction

List the worker deployments in the default namespace

temporal worker deployment list
         Name         CreateTime     CurrentVersion     RampingVersion  RampingVersionPercentage
  hello-world-worker  4 days ago  hello-world-worker.1  <none>                                 0
  1                   5 days ago  __unversioned__       <none>  

Try to delete the hello-world-worker deployment

temporal worker deployment delete --name hello-world-worker
time=2025-06-17T09:57:38.541 level=ERROR msg="error deleting worker deployment: something went wrong, please retry (d564d36c)"

See this error in the logs

Logs
{"level":"error","ts":"2025-06-17T13:57:38.299Z","msg":"deployment client error","error":"deployment has versions, can't be deleted","operation":"DeleteWorkerDeployment","elapsed":0.015479153,"args":["default","hello-world-worker","temporal-cli:xxx"],"logging-call-at":"/home/runner/work/docker-builds/docker-builds/temporal/service/worker/workerdeployment/client.go:1205","stacktrace":"go.temporal.io/server/common/log.(*zapLogger).Error\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/log/zap_logger.go:154\ngo.temporal.io/server/service/worker/workerdeployment.(*ClientImpl).DeleteWorkerDeployment.(*ClientImpl).record.func1\n\t/home/runner/work/docker-builds/docker-builds/temporal/service/worker/workerdeployment/client.go:1205\ngo.temporal.io/server/service/worker/workerdeployment.(*ClientImpl).DeleteWorkerDeployment\n\t/home/runner/work/docker-builds/docker-builds/temporal/service/worker/workerdeployment/client.go:753\ngo.temporal.io/server/service/frontend.(*WorkflowHandler).DeleteWorkerDeployment\n\t/home/runner/work/docker-builds/docker-builds/temporal/service/frontend/workflow_handler.go:3538\ngo.temporal.io/api/workflowservice/v1._WorkflowService_DeleteWorkerDeployment_Handler.func1\n\t/home/runner/go/pkg/mod/go.temporal.io/api@v1.46.0/workflowservice/v1/service_grpc.pb.go:3447\ngo.temporal.io/server/common/rpc/interceptor.(*RetryableInterceptor).Intercept.func1\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/retry.go:62\ngo.temporal.io/server/common/backoff.ThrottleRetryContext\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/backoff/retry.go:89\ngo.temporal.io/server/common/rpc/interceptor.(*RetryableInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/retry.go:66\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*CallerInfoInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/caller_info.go:64\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*SDKVersionInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/sdk_version.go:68\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*RateLimitInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/rate_limit.go:88\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceRateLimitInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/namespace_rate_limit.go:85\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*ConcurrentRequestLimitInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/concurrent_request_limit.go:107\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceValidatorInterceptor).StateValidationIntercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/namespace_validator.go:221\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*HealthInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/health.go:65\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*TelemetryInterceptor).UnaryIntercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/telemetry.go:197\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*Redirection).handleRedirectAPIInvocation.func2\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/redirection.go:265\ngo.temporal.io/server/common/rpc/interceptor.(*NoopRedirectionPolicy).WithNamespaceRedirect\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/dc_redirection_policy.go:125\ngo.temporal.io/server/common/rpc/interceptor.(*Redirection).handleRedirectAPIInvocation\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/redirection.go:262\ngo.temporal.io/server/common/rpc/interceptor.(*Redirection).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/redirection.go:222\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/authorization.(*Interceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/authorization/interceptor.go:178\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/service/frontend.GrpcServerOptionsProvider.NewServerMetricsContextInjectorInterceptor.func2\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/metrics/grpc.go:65\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceLogInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/namespace_logger.go:84\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*NamespaceValidatorInterceptor).NamespaceValidateIntercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/namespace_validator.go:132\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/service/frontend.GrpcServerOptionsProvider.NewFrontendServiceErrorInterceptor.func1\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/grpc.go:178\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc.ServiceErrorInterceptor\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/grpc.go:157\ngoogle.golang.org/grpc.getChainUnaryHandler.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1217\ngo.temporal.io/server/common/rpc/interceptor.(*MaskInternalErrorDetailsInterceptor).Intercept\n\t/home/runner/work/docker-builds/docker-builds/temporal/common/rpc/interceptor/mask_internal_error.go:65\ngoogle.golang.org/grpc.NewServer.chainUnaryServerInterceptors.chainUnaryInterceptors.func1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1208\ngo.temporal.io/api/workflowservice/v1._WorkflowService_DeleteWorkerDeployment_Handler\n\t/home/runner/go/pkg/mod/go.temporal.io/api@v1.46.0/workflowservice/v1/service_grpc.pb.go:3449\ngoogle.golang.org/grpc.(*Server).processUnaryRPC\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1405\ngoogle.golang.org/grpc.(*Server).handleStream\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1815\ngoogle.golang.org/grpc.(*Server).serveStreams.func2.1\n\t/home/runner/go/pkg/mod/google.golang.org/grpc@v1.71.0/server.go:1035"}

Then tried to delete the version, which also errored

temporal worker deployment delete-version --version hello-world-worker.1
time=2025-06-17T10:07:54.029 level=ERROR msg="error deleting worker deployment version: something went wrong, please retry (36634b00)"
Environment/Versions
  • OS and processor: MacBook M1 Pro Sequoia 15.5
  • Temporal Version:
temporal operator cluster system
  ServerVersion  SupportsSchedules  UpsertMemo  EagerWorkflowStart
  1.27.2         true               true        true  
  • Temporal server hosted on EKS

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the temporal worker deployment delete --name and delete-version commands described in the issue against the reported server setup. Trace the worker deployment deletion path, including service/worker/workerdeployment/client.go around lines 753 and 1205, and compare the CLI errors with the server's version-related errors. Done means the deployment and its version can be removed as intended, or the commands report the actual restriction clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.