在AWS Lambda Function中调试外部软件包

时间:2019-02-13 18:48:43

标签: go amazon-cloudformation aws-serverless

在本地运行aws sam并调试调用外部程序包/方法的lambda函数。由于某种原因,我放入外部软件包中的任何调试消息都不会被调用。想知道为什么会这样。还有其他人碰到这个吗?

{
  "errorMessage": "runtime error: invalid memory address or nil pointer dereference",
  "errorType": "errorString",
  "stackTrace": [
    {
      "path": "github.com/aws/aws-lambda-go@v1.6.0/lambda/function.go",
      "line": 27,
      "label": "(*Function).Invoke.func1"
    },
    {
      "path": "runtime/asm_amd64.s",
      "line": 522,
      "label": "call32"
    },
    {
      "path": "runtime/panic.go",
      "line": 513,
      "label": "gopanic"
    },
    {
      "path": "runtime/panic.go",
      "line": 82,
      "label": "panicmem"
    },
    {
      "path": "runtime/signal_unix.go",
      "line": 390,
      "label": "sigpanic"
    },
    {
      "path": "go.uber.org/zap@v1.9.1/logger.go",
      "line": 264,
      "label": "(*Logger).check"
    },
    {
      "path": "go.uber.org/zap@v1.9.1/logger.go",
      "line": 186,
      "label": "(*Logger).Info"
    },
    {
      "path": "github.com/goop/service-wms-snoop/transferorders/handlers.go",
      "line": 76,
      "label": "TransferOrdersPublishHandler"
    },
    {
      "path": "runtime/asm_amd64.s",
      "line": 526,
      "label": "call512"
    },
    {
      "path": "reflect/value.go",
      "line": 447,
      "label": "Value.call"
    },
    {
      "path": "reflect/value.go",
      "line": 308,
      "label": "Value.Call"
    },
    {
      "path": "github.com/aws/aws-lambda-go@v1.6.0/lambda/handler.go",
      "line": 111,
      "label": "newHandler.func1"
    },
    {
      "path": "github.com/aws/aws-lambda-go@v1.6.0/lambda/handler.go",
      "line": 22,
      "label": "lambdaHandler.Invoke"
    },
    {
      "path": "github.com/aws/aws-lambda-go@v1.6.0/lambda/function.go",
      "line": 59,
      "label": "(*Function).Invoke"
    },
    {
      "path": "runtime/asm_amd64.s",
      "line": 523,
      "label": "call64"
    },
    {
      "path": "reflect/value.go",
      "line": 447,
      "label": "Value.call"
    },
    {
      "path": "reflect/value.go",
      "line": 308,
      "label": "Value.Call"
    },
    {
      "path": "net/rpc/server.go",
      "line": 384,
      "label": "(*service).call"
    },
    {
      "path": "runtime/asm_amd64.s",
      "line": 1333,
      "label": "goexit"
    }
  ]
}

以上是stackTrace。我跟踪了处理程序,以发现它在调用外部程序包/方法时崩溃。

0 个答案:

没有答案