artillery-dino icon indicating copy to clipboard operation
artillery-dino copied to clipboard

Cannot find module 'index'

Open jinho-scenappsm opened this issue 9 years ago • 4 comments

I installed dino on my centos 7 today. And I tested with below script, but no luck.


./dino run -k -n 200 -c 10 -l 7 -t http://.../api/test

                      _._
                    _/:|:
                   /||||||.
                   ||||||||.
                  /|||||||||:

_ _ /||||||||||| | ||___ ___ .||||||||||||| | . | | | . | | ||||||||||||: |||||_| /| |||||||||||||:=---.._ | | |||||:'''':|| '~-._ '-. /| | ||' '-. _: ; | | | ' '~~ _; | ' .=. _-~ .~ { '-' .--=.-~ .. { } .-~ @-, { '-. _. '~==+ | (' } _ _.=~ | | =======' /_ ~-_ ) <_oo_> -----~~/ /'===...===' + / <oo> / // / // <oo>

Expecting to make up to 14000 requests { StatusCode: 200, FunctionError: 'Unhandled', LogResult: 'U1RBUlQgUmVxdWVzdElkOiBkNDE4MDNlYy0xZDg4LTExZTYtOWQxYS0yZGZiN2EyOTgwZGYgVmVyc2lvbjogJExBVEVTVApVbmFibGUgdG8gaW1wb3J0IG1vZHVsZSAnaW5kZXgnOiBFcnJvcgogICAgYXQgRnVuY3Rpb24uTW9kdWxlLl9yZXNvbHZlRmlsZW5hbWUgKG1vZHVsZS5qczozMzg6MTUpCiAgICBhdCBGdW5jdGlvbi5Nb2R1bGUuX2xvYWQgKG1vZHVsZS5qczoyODA6MjUpCiAgICBhdCBNb2R1bGUucmVxdWlyZSAobW9kdWxlLmpzOjM2NDoxNykKICAgIGF0IHJlcXVpcmUgKG1vZHVsZS5qczozODA6MTcpCkVORCBSZXF1ZXN0SWQ6IGQ0MTgwM2VjLTFkODgtMTFlNi05ZDFhLTJkZmI3YTI5ODBkZgpSRVBPUlQgUmVxdWVzdElkOiBkNDE4MDNlYy0xZDg4LTExZTYtOWQxYS0yZGZiN2EyOTgwZGYJRHVyYXRpb246IDAuNDggbXMJQmlsbGVkIER1cmF0aW9uOiAxMDAgbXMgCU1lbW9yeSBTaXplOiA1MTIgTUIJTWF4IE1lbW9yeSBVc2VkOiAxNyBNQgkK', Payload: '{"errorMessage":"Cannot find module 'index'","errorType":"Error","stackTrace":["Function.Module._resolveFilename (module.js:338:15)","Function.Module._load (module.js:280:25)","Module.require (module.js:364:17)","require (module.js:380:17)"]}' } START RequestId: d41803ec-1d88-11e6-9d1a-2dfb7a2980df Version: $LATEST Unable to import module 'index': Error at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) END RequestId: d41803ec-1d88-11e6-9d1a-2dfb7a2980df REPORT RequestId: d41803ec-1d88-11e6-9d1a-2dfb7a2980df Duration: 0.48 ms Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 17 MB

/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/request.js:30 throw err; ^

Error at Response. (/usr/local/lib/node_modules/artillery-dino/lib/commands/run.js:180:15) at Request. (/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/request.js:354:18) at Request.callListeners (/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/sequential_executor.js:105:20) at Request.emit (/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/request.js:596:14) at Request.transition (/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/request.js:21:10) at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/state_machine.js:14:12) at /usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request. (/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/request.js:37:9) at Request. (/usr/local/lib/node_modules/artillery-dino/node_modules/aws-sdk/lib/request.js:598:12)

jinho-scenappsm avatar May 19 '16 06:05 jinho-scenappsm

Getting the exact same error on OSX 10.9.5.

ndmgrphc avatar Jul 05 '16 01:07 ndmgrphc

lambda.zip is structured wrong. Solved this issue by decompressing lambda.zip and recompressing the contents rather than their parent directory. In osx, this will result in an archive named Archive.zip. Lambda (no longer?) does not accept zip archives where the root item is a directory as it would be if you (built the app iin ./lambda and) zipped ./lambda.

tl;dr don't zip ./lambda, zip ./lambda/*

Working on a fork, now.

ndmgrphc avatar Jul 06 '16 19:07 ndmgrphc

@ndmgrphc which fork (I can't see one on the github network)?

Have you been using dino successfully?

hayd avatar Sep 10 '16 05:09 hayd

Agree with @ndmgrphc . Was able to run Dino successfully after decompress and recompressing the contents and then uploading it to the Lambda function manually.

roh26it avatar Nov 09 '16 08:11 roh26it