我有一个回购https://github.com/BuilderHarrison/temporal-hello-world-dsl,当我运行它时,它50%的时间失败,50%的时候成功.我对时态和无服务器sdk都很陌生.所以我不知道如何继续调试这个问题.我遇到的问题是:

{
  "type": "workflowExecutionFailedEventAttributes",
  "failure": {
    "message": "unable to decode the workflow function input payload with error: payload item 0: unable to decode: json: cannot unmarshal object into Go struct field Workflow.Start of type string, function name: HelloWorld",
    "source": "GoSDK",
    "stackTrace": "",
    "cause": {
      "message": "payload item 0: unable to decode: json: cannot unmarshal object into Go struct field Workflow.Start of type string",
      "source": "GoSDK",
      "stackTrace": "",
      "cause": {
        "message": "unable to decode: json: cannot unmarshal object into Go struct field Workflow.Start of type string",
        "source": "GoSDK",
        "stackTrace": "",
        "cause": {
          "message": "unable to decode",
          "source": "GoSDK",
          "stackTrace": "",
          "cause": null,
          "applicationFailureInfo": {
            "type": "",
            "nonRetryable": false,
            "details": null
          }
        },
        "applicationFailureInfo": {
          "type": "wrapError",
          "nonRetryable": false,
          "details": null
        }
      },
      "applicationFailureInfo": {
        "type": "wrapError",
        "nonRetryable": false,
        "details": null
      }
    },
    "applicationFailureInfo": {
      "type": "wrapError",
      "nonRetryable": false,
      "details": null
    }
  },
  "retryState": "RetryPolicyNotSet",
  "workflowTaskCompletedEventId": "7",
  "newExecutionRunId": ""
}

作为参考,我提供的json文件是:

{
    "id": "helloworld",
    "version": "1.0",
    "specVersion": "0.8",
    "name": "Hello World Workflow",
    "description": "Hello World",
    "start": "Hello State",
    "states": [
      {
        "name": "Hello State",
        "type": "operation",
        "actionMode": "sequential",
        "actions": [
          {
            "functionRef": {
              "refName": "PrintHelloWorld1",
              "arguments": {
                "arg1": "Hello World1!"
              }
            }
          },
            {"functionRef": {
                "refName": "PrintHelloWorld2",
                "arguments": {
                  "arg1": "Hello World2!"
                }
              }
            }
        ],
        "end": true
      }
    ]
  }

如有任何帮助,我们将不胜感激!

干杯

推荐答案

50%的时间错误通常是由于存在两个工作进程,其中一个在旧的/不兼容的代码版本上.您是否有可能在不同的shell中或在后台使用旧的辅助进程?

Go相关问答推荐

使用恶意软件 scanner (ClamAV)时的Google云存储桶上传文件验证

消费者在NAT中是如何实现的

Golang XML密钥名称冲突

Hugo错误:没有为此项目配置现有内容目录

将DATE类型的SQL字段扫描到GO struct 字段

我找不到pcap.Openlive的设备名称

如何在正则表达式中使整个单词可选?

如何将字节文件高效地读入int64切片?

使用GOTK3和librsvg在Go中如何加载内联SVG?

如何使用 GolangCI 删除未使用的导入

如何确定作为函数参数传递的指针是否正在被修改或副本是否正在被修改?

如何使用 Go 代理状态为 OK 的预检请求?

Go gmail api 快速入门导致本地主机拒绝连接 ERR_CONNECTION_REFUSED

使用 package`regexp` 查找 Golang 中的所有 mactch 子字符串,但得到意外结果

go:识别重新定义标志的包

如何通过组合来自不同包的接口来创建接口?

如何正确为 Go 中的值设置多种类型?

如何在golang中使用ozzo验证进行时间最大验证

如何断言类型是指向golang中接口的指针

关于GO的几个问题