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

Error [TypeError]: AWS[serviceName] is not a constructor #2085

Open
ismaelalfarojr opened this issue Sep 4, 2024 · 9 comments
Open

Error [TypeError]: AWS[serviceName] is not a constructor #2085

ismaelalfarojr opened this issue Sep 4, 2024 · 9 comments

Comments

@ismaelalfarojr
Copy link

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

@fmmorais
Copy link

fmmorais commented Sep 5, 2024

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: #2059.

I hope it helps! Thanks for jumping into these errors!

@fmmorais
Copy link

fmmorais commented Sep 5, 2024

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?

@DanielIntruder
Copy link

DanielIntruder commented Sep 10, 2024

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

@morpheuslord
Copy link

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

How do you do that, can you give steps to do it?

@DanielIntruder
Copy link

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

How 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 aws-sdk@2.1680.0 should also work.

@morpheuslord
Copy link

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

How 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 aws-sdk@2.1680.0 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"}

@tuandat1303
Copy link

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

How 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 aws-sdk@2.1680.0 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"}

@morpheuslord
Copy link

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

How 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 aws-sdk@2.1680.0 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 👍 .

@ajutamangdev
Copy link

Thank you @DanielIntruder . Its working after I updated the package.

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

6 participants