簡體   English   中英

AWS Lambda function 在步驟 function 返回“Runtime.HandlerNotFound”

[英]AWS Lambda function in Step function returns "Runtime.HandlerNotFound"

問題:當我嘗試運行步驟 Function(帶有 Lambda 函數)時,我收到以下錯誤消息:

Runtime.HandlerNotFound in step: SolarEdgeOvervie

原因>

{
  "errorType": "Runtime.HandlerNotFound",
  "errorMessage": "index.handler is undefined or not exported",
  "trace": [
    "Runtime.HandlerNotFound: index.handler is undefined or not exported",
    "    at Object.module.exports.load (/var/runtime/UserFunction.js:144:11)",
    "    at Object.<anonymous> (/var/runtime/index.js:43:30)",
    "    at Module._compile (internal/modules/cjs/loader.js:999:30)",
    "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
    "    at Module.load (internal/modules/cjs/loader.js:863:32)",
    "    at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
    "    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
    "    at internal/main/run_main_module.js:17:47"
  ]
}

// Task failed by SolarEdgeOverview 

{
  "resourceType": "lambda",
  "resource": "invoke",
  "error": "Runtime.HandlerNotFound",
  "cause": {
    "errorType": "Runtime.HandlerNotFound",
    "errorMessage": "index.handler is undefined or not exported",
    "trace": [
      "Runtime.HandlerNotFound: index.handler is undefined or not exported",
      "    at Object.module.exports.load (/var/runtime/UserFunction.js:144:11)",
      "    at Object.<anonymous> (/var/runtime/index.js:43:30)",
      "    at Module._compile (internal/modules/cjs/loader.js:999:30)",
      "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
      "    at Module.load (internal/modules/cjs/loader.js:863:32)",
      "    at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
      "    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
      "    at internal/main/run_main_module.js:17:47"
    ]
  }
}

// Excution failed

{
  "error": "Runtime.HandlerNotFound",
  "cause": {
    "errorType": "Runtime.HandlerNotFound",
    "errorMessage": "index.handler is undefined or not exported",
    "trace": [
      "Runtime.HandlerNotFound: index.handler is undefined or not exported",
      "    at Object.module.exports.load (/var/runtime/UserFunction.js:144:11)",
      "    at Object.<anonymous> (/var/runtime/index.js:43:30)",
      "    at Module._compile (internal/modules/cjs/loader.js:999:30)",
      "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
      "    at Module.load (internal/modules/cjs/loader.js:863:32)",
      "    at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
      "    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
      "    at internal/main/run_main_module.js:17:47"
    ]
  }
}

我認為我使用了默認設置。

我懷疑我沒有正確設置 Step-Function,或者當我對錯誤進行一些研究時,我可能沒有給予“index.handler”或 Zip 等足夠的權限。

永久解決此問題的最佳方法是使用像serverless這樣的自動化工具,讓該工具為您處理文件夾結構和部署。 結帳此鏈接

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM