LoginSignup
0
0

More than 5 years have passed since last update.

Lambdaの関数実行時に毎回エラーが異なる現象が起きたら

Posted at

普段運用しているシステムのLambda実行時にエラーが発生しました。
Node.js を用いて開発していたのですが、最初に出た時のエラーは以下の通りです。

{"errorCode":"<定義したエラー名>","error":"{\"code\":500,\"message\":\"Forwarding error\"}"}

内部でWatsonにアクセスしているのですがどうやらWatsonの接続部分で失敗しているみたいです。

再現するか何回か試したところ、毎回違うエラーがでてしまう始末。。。

SyntaxError: Unexpected end of JSON input at Object.

TypeError: Cannot read property 'statusCode' of undefined at Request._callback

{"errorCode":"<定義したエラー名>","error":"<HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>\nAn error occurred while processing your request.<p>\nReference&#32;&#35;97&#46;bf7f3517&#46;1532497074&#46;fdbb3e7\n</BODY></HTML>\n","statusCode":500}

Process exited before completing request

そこで、ログをしばらく眺めていると、エラー以外のメッセージで以下に注目してみました。

Duration: 21587.75 ms   Billed Duration: 21600 ms Memory Size: 128 MB   Max Memory Used: 128 MB

メモリを上限まで使っている?
そこで、メモリを試しに上げてみたところ、エラーは出なくなりました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0