Skip to content

Lambda RunTime Error

0

Without making any changes, my Lambda function is now throwing this error. Can you please help resolve it?

``

`{
  "errorType": "TypeError",
  "errorMessage": "Object.defineProperty called on non-object",
  "trace": [
    "TypeError: Object.defineProperty called on non-object",
    "    at defineProperty (<anonymous>)",
    "    at __name (/var/task/dist/index.js:83029:37)",
    "    at <static_initializer> (/var/task/dist/index.js:83221:9)",
    "    at node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js (/var/task/dist/index.js:83216:34)",
    "    at __require (/var/task/dist/index.js:13:51)",
    "    at node_modules/@aws-sdk/client-s3/dist-cjs/index.js (/var/task/dist/index.js:86346:37)",
    "    at __require (/var/task/dist/index.js:13:51)",
    "    at dist/src/lib/common_modules.js (/var/task/dist/index.js:96900:23)",
    "    at __require (/var/task/dist/index.js:13:51)",
    "    at dist/src/chargingSessions/queries.js (/var/task/dist/index.js:97202:28)"
  ]
}`

``

asked 2 years ago199 views

1 Answer
0

The error you're experiencing with your Lambda function is likely due to an unexpected runtime version update. Lambda automatically updates functions to the most recent and secure runtime version by default. However, sometimes these updates can cause compatibility issues with existing code.

To resolve this issue, you can try the following steps:

  1. Check if the error coincides with an automatic runtime update. You can do this by reviewing your function's logs or checking the runtime version history.

  2. If it is related to a runtime update, you can try to revert to the last known working version of the runtime. To do this:

    • Open the Lambda console and navigate to your function
    • Go to the "Runtime settings" section
    • Click on "Edit runtime management configuration"
    • Change the "Runtime management configuration" from "Auto" to "Manual"
    • Specify the last known working runtime version ARN
  3. If reverting doesn't solve the issue, you may need to update your code to be compatible with the new runtime version. This could involve updating dependencies or modifying code that relies on specific runtime behaviors.

  4. After making any changes, test your function thoroughly to ensure it works as expected.

  5. If you continue to face issues, consider reaching out to AWS Support for further assistance.

Remember to back up your Lambda function before making any changes. It's also a good practice to implement a robust testing strategy to catch these kinds of issues before they affect your production environment.

If you decide to keep the manual runtime management, make sure to periodically check for new runtime versions and update your function when appropriate to ensure you have the latest security patches and features.

Sources
Troubleshoot Lambda function runtime version errors | AWS re:Post
Upgrade Lambda function runtime to latest version | AWS re:Post
Configuring Lambda runtime management settings - AWS Lambda

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.