question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lambda: Cannot read properties of null (reading 'toString')

See original GitHub issue

Version info:

Artillery Core: 2.0.0-23
Artillery Pro:  not installed (https://artillery.io/product)

Node.js: v19.0.0
OS:      win32

Running this command:

artillery run --platform aws:lambda --platform-opt region=us-east-1 --environment 29r artillery-test.yml

I expected to see this happen:

Lambda would spin up and run the tests.

Instead, this happened:

Failure with this error message output:

λ Creating AWS Lambda function...
    - Installing dependencies
C:\Users\17077\AppData\Roaming\npm\node_modules\artillery\lib\platform\aws-lambda\index.js:104
      artillery.log(stdout.toString(), stderr.toString(), status, error);
                           ^

TypeError: Cannot read properties of null (reading 'toString')
    at PlatformLambda.init (C:\Users\17077\AppData\Roaming\npm\node_modules\artillery\lib\platform\aws-lambda\index.js:104:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Launcher.run (C:\Users\17077\AppData\Roaming\npm\node_modules\artillery\lib\launch-platform.js:351:25)

Node.js v19.0.0

Files being used:

Changed for obscurity/security reasons but this is the artllery-test.yml file:

config:
  environments:
    29r:
      target: "https://example.com"
      variables:
        apiKey: "123456"
        eventGuid: "8d683883-6519-44ba-b25a-655c6490c1d7"
  phases:
    - duration: 300
      arrivalRate: 500
  before:
    flow:
      - name: "Get member IDs for the Event"
      - get:
        url: "/origin/GetAllMembers/{{ eventGuid }}"
        headers:
          X-ApiKey: "{{ apiKey }}"
        capture:
          - json: "$"
            as: "memberIds"
scenarios:
  - name: "Get Member Origins"
    flow:
      - loop:
          - get:
              url: "/origin/RetrieveOrigins/{{ $loopElement }}"
        over: "{{ $memberIds }}"

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
adamfishercommented, Dec 1, 2022

Nope. Artillery doesn’t appear to work even on the happy path for Lambda integration.

0reactions
mikevercoelencommented, Dec 14, 2022

same issue here, MemorySize error.

I double checked my AWS quotes, and my quota for lambda max mem size for the region I’m targetting is 10gb.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS lambda TypeError: Cannot read property 'toString' of ...
In the above code line var connectionString=data.Body.toString(); am converting the received data to string but the toString() is not working.
Read more >
TypeError: Cannot read property 'toString' of Null in JS
The "Cannot read property 'toString' of null" error occurs when the toString() method is called on a null value. To solve the error,...
Read more >
TypeError: Cannot read property 'toString' of null Error on AWS ...
I'm getting the following error in the SAM local environment: { "errorType": "TypeError", "errorMessage": "Cannot read property 'toString' ...
Read more >
AWS Lambda function errors in Node.js
This page describes how to view Lambda function invocation errors for the Node.js runtime using the Lambda console and the AWS CLI.
Read more >
Node.js v19.3.0 Documentation
node:crypto module methods and properties ... CORS is never checked on the destination server; Cannot load non-network ... ifError(null); // OK assert.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found