1、启动 worker 失败
 
| INFO No Lofigured fortemporal client. Created default one.
 Unable to create client failed reaching server: upstream connect error ordisconnect/reset before headers. reset reason: connection failure
 | 
 
解决:没找到链接资源,需检查服务发现相关代码再次重试即可。
 
2、Failed to poll for task
 
| 2023/06/0211:54:50WARN  Failed to poll fortask. Namespace temporal-eco TaskQueue hello-world WorkerID 3351@z--debug-xujialong01-51150-57f5f4c9bb-n6xjk@ WorkerType WorkflowWorker Error unexpected HTTP status code received fromserver: 504(Gateway Timeout); transport: received unexpected content-type"text/html"
 | 
 
Worker Failed to poll for task - #3 by nitesh237 - Community Support - Temporal
 
翻译下:当在没有可执行的 Workflow 任务的时,Worker 会长轮询超时(Go SDK为70)警告,属于正常日志。
 
3、工作流数据丢失
 
Temporal workflow 数据默认保留三天(Namespace 维度),需调整数据保留时限(目前最大支持 30 天)
 
4、Namespace not found
 
| 2023/08/1315:25:54INFO  No logger configured fortemporal client. Created default one.
 2023/08/1315:25:54Unable to execute workflow Namespace temporal-namespace isnotfound.
 exit status 1
 | 
 
需注册命名空间(业务资源隔离)
 
5、定时工作流启动后报 Schedules are disabled
 
temporal 默认是没有开启 schedule 的,需 enableSchedule
 
6、定时工作流异常
 
(1)指定的时间点没有触发
 
使用姿势不对
 
- 参数设置:时区
- Queue 映射一致(starter、worker)
(2)已经成功执行了但是 temporal 还是显示 running
 
定时 schedule workflow 需要手动关闭
 
7、No Workers Running
 
解决:检查业务 worker 容器状态。可能是容器未启动或容器 hang 住
 
8、grpc: the client connection is closing
 
解决:连接失败,请检查获取 temporal client 的代码
 
 可参考:
 
9、unable to decode: json: cannot unmarshal number
 
| unable to decode the activity function inputpayload with error: payload item 1: unable to decode: json: cannot unmarshal number into Go value of type[]*workflow.Item forfunction name: GenerateEachLineDataActivity
 | 
 
解决:Json 大整数反序列化需要指定结果目标类型为指针,否则报 cannot unmarshal number
 
 可参考:
 
10、Workflow 失败后支持重试
 
针对非预期重试失败,解决偶然性问题的,可支持
 
 
| //Reset workflow execution
 _, err =c.ResetWorkflowExecution(context.Background(), &workflowservice.ResetWorkflowExecutionRequest{
     Namespace: "default", //命名空间
     WorkflowExecution: &commonpb.WorkflowExecution{
         WorkflowId: "hello_world_123",                      //工作流 ID
         RunId:      "95aec3f8-71b2-4936-9daf-7af722284a15", //运行 ID
     },
     Reason:                    "reset execution from test", //重置原因(自定义)
     WorkflowTaskFinishEventId: 10,                          //完成态事件ID(仅接受 `WORKFLOW_TASK_COMPLETED`,`WORKFLOW_TASK_TIMED_OUT`, `WORKFLOW_TASK_FAILED`, `WORKFLOW_TASK_STARTED` 状态下的事件 ID)
 })
 |