18

I recently updated my lambda Node.js runtime from 8.x to 12.x. I upgraded lots of dependencies and optimized the bundling with webpack and the deployment process. BUT, I started to notice sporadic errors in Cloudwatch with a cryptic message "Unknown application error occurred" with no stack trace or any other log that could give me some context about the function input. There is no way for me to debug this code, and it appears to be a native AWS error that cannot even invoke the function for some reason, otherwise, there would be a JS stack trace attached to the log...

I'm starting to think there is a Webpack issue, but I even disabled the minification process so I have no clue where to look.

My code is 100% Typescript compiled using Webpack & Babel. Should I try removing Webpack from the build process and just zip the Typescript compiler output with the plain node_modules folder and no bundling whatsoever?

Can someone please help me? This function is in production!

EDIT: I see a bunch of warnings like DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead., and I am aware of, but it should not be the cause of this cryptic error.

6
  • Does this answer your question? Lambda code works on node v8.10 but not nodejs v10.x Commented Jan 27, 2020 at 14:02
  • Nope, that is not the same error. I have no stack trace associated with it. Commented Jan 27, 2020 at 16:43
  • Did you find a solution for this ? Commented Aug 4, 2020 at 14:20
  • It did go away after some code refactoring. Never new what was the problem Commented Aug 14, 2020 at 21:04
  • same problem here... our application is written with typescript without webpack so I don't think webpack is the problem here Commented Oct 15, 2021 at 13:06

1 Answer 1

5

I've recently had this error but my error happened every other request. First request I get a good response, the second (same) request, I get the error "Unknown application error occurred".

I was using NodeJS mysql2 module and was not closing the pool connection properly after each request which forced the second request to fail, then NodeJS resets and the following request is good again.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.