Skip to content

Using Exceptionless for nodejs causes problems with AWS Lambda functions #140

Description

@kareldonk

I tried using the exceptionless client for nodejs @exceptionless/node version 3.0.4 as follows:

 await Exceptionless.startup(c => {
            c.apiKey = 'blah';
        });

When running the program as an AWS Lambda function, it throws the following error:

{
    "errorType": "Error",
    "errorMessage": "ENOENT: no such file or directory, mkdir '/var/task/.exceptionless'",
    "code": "ENOENT",
    "errno": -2,
    "syscall": "mkdir",
    "path": "/var/task/.exceptionless",
    "stack": [
        "Error: ENOENT: no such file or directory, mkdir '/var/task/.exceptionless'",
        "    at Object.mkdirSync (node:fs:1398:3)",
        "    at LocalStorage._init (/var/task/node_modules/node-localstorage/LocalStorage.js:174:16)",
        "    at new LocalStorage (/var/task/node_modules/node-localstorage/LocalStorage.js:114:14)",
        "    at NodeExceptionlessClient.startup (file:///var/task/node_modules/@exceptionless/node/dist/NodeExceptionlessClient.js:13:57)",
        "    at ExceptionlessService.startup (file:///var/task/dist/services/exceptionless.service.js:27:29)",
        "    at AppModule.getAppContext (file:///var/task/dist/app.module.js:34:40)",
        "    at async AppModule.getAppService (file:///var/task/dist/app.module.js:40:25)",
        "    at async handle (file:///var/task/dist/index.js:17:24)",
        "    at async Runtime.handler (file:///var/task/dist/index.js:6:5)",
        "    at async Runtime.handleOnceStreaming (file:///var/runtime/index.mjs:1206:26)"
    ]
}

This is caused by the NodeExceptionlessClient class using the LocalStoragePolyfill.
It's not possible to write to the partition where the script runs on AWS Lambda as far as I know. I couldn't find a way to override the usage of the LocalStoragePolyfill to use memory storage either. Am I overlooking something or is this an issue that needs to be addressed?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions