Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module run-fargate.js on a Multiple Scenario specs. #2590

Open
saurabhmarwaha opened this issue Mar 21, 2024 · 0 comments
Open

Comments

@saurabhmarwaha
Copy link

saurabhmarwaha commented Mar 21, 2024

Issue: Cannot find module run-fargate.js on a Multiple Scenario specs. Note: If I keep the config and scenario in one file, it works.

Am I giving a wrong execution command?
Followed: https://github.com/artilleryio/artillery/tree/main/examples/multiple-scenario-specs

Summary:
Trying to execute simple script that hits http endpoint which executes perfectly fine locally, but when I try to scale using AWS Lambda, I am getting an issue 'module not found' (run-fargate.js).However, not sure why it's looking for run-fargate module when ideally it should call run-lambda.js which is also in lib/cmds folder.

Also, notice that it doesn't bundle

  • package.json
  • package-lock.json

Version info:

NPM VERSION: 10.2.4

Artillery: 2.0.8
Node.js:   v20.11.1
OS:        win32

Running this command:

PS C:\Users\<<user>>\Documents\testing> artillery run-lambda --config common-config.yml scenarios/backend-endpoint-matrix.yml --region us-east-1

Error:

[MODULE_NOT_FOUND] ModuleLoadError Plugin: artillery: [MODULE_NOT_FOUND] require failed to load /var/task/node_modules/artillery/lib/cmds/run-fargate.js: Cannot find module 'rc'\n"

Terminal:

Powershell with Set-ExecutionPolicy RemoteSigned
Also tried on bash terminal

Execution

Test run id: tqy53_6qhqhn9j4eq5ertgbhezegb5zd57x_hyem
NOTE: AWS Lambda support is experimental. Not all Artillery features work yet.
For details please see https://docs.art/aws-lambda

λ Creating AWS Lambda function...

  • Bundling test data
    • common-config.yml
    • scenarios\backend-endpoint-matrix.yml
  • Installing dependencies
  • Creating zip package
    Preparing AWS environment...
  • Lambda function: artilleryio-tqy53_6qhqhn9j4eq5ertgbhezegb5zd57x_hyem
  • Region: us-east-1
  • AWS account: <>
    [d45553d2-2aef-4a13-b1cc-62d02a9f029f]: A Lambda function has exited with an error. Reason: ArtilleryError
    {
    stdout: 'Test run id: tqy53_6qhqhn9j4eq5ertgbhezegb5zd57x_hyem\n',
    stderr: "(node:25) [MODULE_NOT_FOUND] ModuleLoadError Plugin: artillery: [MODULE_NOT_FOUND] require failed to load /var/task/node_modules/artillery/lib/cmds/run-fargate.js: Cannot find module 'rc'\n"
  • 'Require stack:\n' +
    '- /var/task/node_modules/artillery/lib/platform/aws-ecs/legacy/run-cluster.js\n' +
    '- /var/task/node_modules/artillery/lib/cmds/run-fargate.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/module-loader.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/help/util.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/help/formatter.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/help/command.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/help/index.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/flags.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/cli-ux/styled/table.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/cli-ux/styled/index.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/cli-ux/index.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/command.js\n' +
    '- /var/task/node_modules/artillery/node_modules/@oclif/core/lib/index.js\n' +
    '- /var/task/node_modules/artillery/bin/run\n' +
    'module: @oclif/core@2.15.0\n' +
    'task: toCached\n' +
    'plugin: artillery\n' +
    'root: /var/task/node_modules/artillery\n' +
    'See more details with DEBUG=*\n' +
    '(Use node --trace-warnings ... to show where the warning was created)\n' +
    ' Error: ENOENT: no such file or directory, open \n' +
    " 'scenarios\backend-endpoint-matrix.yml'\n" +
    ' Code: ENOENT\n' +
    "[Error: ENOENT: no such file or directory, mkdir '/home/sbx_user1051'] {\n" +
    ' errno: -2,\n' +
    " code: 'ENOENT',\n" +
    " syscall: 'mkdir',\n" +
    " path: '/home/sbx_user1051'\n" +
    '}\n'
    }
    Summary report @ 20:29:31(-0400)
    No measurements recorded during this period

Estimated AWS Lambda cost for this test: $0.001
cmds

Files being used:

AppData\Roaming\npm\node_modules\artillery\lib\cmds  - See Screenshot


Folder tree: testing\scenarios\backend-endpoint-matrix
``
# https://github.com/artilleryio/artillery/blob/main/examples/http-metrics-by-endpoint/endpoint-metrics.yml
# https://github.com/artilleryio/artillery/tree/main/examples/multiple-scenario-specs
scenarios:
  - name: backendEndpoint
    flow:
      - get:
          url: "/"
          expect:
            statusCode: 200

``

testing\common-config.yml
config:
  target: https://domain.com
  phases:
    - duration: 20
      arrivalRate: 1
      rampTo: 5
      name: Warm up phase

Package.json attached.

package.json

Node_modules installed. See SS
Node_Module

Cloudwatch Logs

2024-03-21T06:23:32.382Z 9b0dee15-735e-41f5-9a72-eefd4a4672ae ERROR (node:24) [MODULE_NOT_FOUND] ModuleLoadError Plugin: artillery: [MODULE_NOT_FOUND] require failed to load /var/task/node_modules/artillery/lib/cmds/run-fargate.js: Cannot find module 'rc'
Require stack:

  • /var/task/node_modules/artillery/lib/platform/aws-ecs/legacy/run-cluster.js
  • /var/task/node_modules/artillery/lib/cmds/run-fargate.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/module-loader.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/help/util.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/help/formatter.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/help/command.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/help/index.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/flags.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/cli-ux/styled/table.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/cli-ux/styled/index.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/cli-ux/index.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/command.js
  • /var/task/node_modules/artillery/node_modules/@oclif/core/lib/index.js
  • /var/task/node_modules/artillery/bin/run
    module: @oclif/core@2.15.0
    task: toCached
    plugin: artillery
    root: /var/task/node_modules/artillery
    See more details with DEBUG=*
    (Use node --trace-warnings ... to show where the warning was created)
@saurabhmarwaha saurabhmarwaha changed the title Cannot find module run-fargate.js Cannot find module run-fargate.js on a Multiple Scenario specs. Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant