Error [TypeError]: AWS[serviceName] is not a constructor
Cloned and setup per instructions. First run produced the error below:
Error [TypeError]: AWS[serviceName] is not a constructor at /home/kali/cloudsploit/collectors/aws/collector.js:139:119 at /home/kali/cloudsploit/node_modules/async/dist/async.js:3113:16 at replenish (/home/kali/cloudsploit/node_modules/async/dist/async.js:1014:17) at /home/kali/cloudsploit/node_modules/async/dist/async.js:1019:9 at Object.eachLimit$1 (/home/kali/cloudsploit/node_modules/async/dist/async.js:3199:24) at /home/kali/cloudsploit/collectors/aws/collector.js:109:23 at replenish (/home/kali/cloudsploit/node_modules/async/dist/async.js:1014:17) at /home/kali/cloudsploit/node_modules/async/dist/async.js:1019:9 at Object.eachOfLimit (/home/kali/cloudsploit/node_modules/async/dist/async.js:1044:24) at /home/kali/cloudsploit/collectors/aws/collector.js:88:19 { code: 'TypeError', time: 2024-09-04T21:18:03.251Z }
Node.js v18.20.1
I debugged this error and found the codestar plugins to be causing it. I removed those two tests and then this error wasn`t thrown anymore. Nevertheless, the error in this thread started to be thrown: https://github.com/aquasecurity/cloudsploit/issues/2059.
I hope it helps! Thanks for jumping into these errors!
Version 3.4.0 runs perfectly if Codestar plugins are removed. As version 3.5.0 included a new plugin for Codestar (CodeStarHasTags) would that one be a candidate for the root cause of this error?
This crash can be resolved by downgrading aws-sdk to version 2.1680.0 or lower. Version 2.1681.0 of the SDK deprecated CodeStar: https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#216810
This crash can be resolved by downgrading
aws-sdkto version 2.1680.0 or lower. Version 2.1681.0 of the SDK deprecated CodeStar: https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#216810
How do you do that, can you give steps to do it?
This crash can be resolved by downgrading
aws-sdkto version 2.1680.0 or lower. Version 2.1681.0 of the SDK deprecated CodeStar: https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#216810How do you do that, can you give steps to do it?
I edited the package.json file to replace the aws-sdk dependency line with "aws-sdk": "2.1680.0",. I believe npm i [email protected] should also work.
This crash can be resolved by downgrading
aws-sdkto version 2.1680.0 or lower. Version 2.1681.0 of the SDK deprecated CodeStar: https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#216810How do you do that, can you give steps to do it?
I edited the
package.jsonfile to replace theaws-sdkdependency line with"aws-sdk": "2.1680.0",. I believenpm i [email protected]should also work.
This worked but now another issue started
[INFO][REGIONS] Could not load all regions from EC2: {"message":"Missing region in config","code":"ConfigError","time":"2024-10-17T13:10:58.627Z"}
This crash can be resolved by downgrading
aws-sdkto version 2.1680.0 or lower. Version 2.1681.0 of the SDK deprecated CodeStar: https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#216810How do you do that, can you give steps to do it?
I edited the
package.jsonfile to replace theaws-sdkdependency line with"aws-sdk": "2.1680.0",. I believenpm i [email protected]should also work.This worked but now another issue started
[INFO][REGIONS] Could not load all regions from EC2: {"message":"Missing region in config","code":"ConfigError","time":"2024-10-17T13:10:58.627Z"}
How to fix it?
[INFO][REGIONS] Could not load all regions from EC2: {"message":"Missing region in config","code":"ConfigError","time":"2024-10-31T09:05:22.269Z"}
This crash can be resolved by downgrading
aws-sdkto version 2.1680.0 or lower. Version 2.1681.0 of the SDK deprecated CodeStar: https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#216810How do you do that, can you give steps to do it?
I edited the
package.jsonfile to replace theaws-sdkdependency line with"aws-sdk": "2.1680.0",. I believenpm i [email protected]should also work.This worked but now another issue started
[INFO][REGIONS] Could not load all regions from EC2: {"message":"Missing region in config","code":"ConfigError","time":"2024-10-17T13:10:58.627Z"}How to fix it?
[INFO][REGIONS] Could not load all regions from EC2: {"message":"Missing region in config","code":"ConfigError","time":"2024-10-31T09:05:22.269Z"}
I used the docker image instead of running this locally 👍 .
Thank you @DanielIntruder . Its working after I updated the package.
Removed codestar plugins from running, https://github.com/aquasecurity/cloudsploit/pull/2130. Thanks