Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

UnhandledPromiseRejectionWarning #75

Open
khannavin opened this issue Mar 12, 2020 · 8 comments
Open

UnhandledPromiseRejectionWarning #75

khannavin opened this issue Mar 12, 2020 · 8 comments
Assignees

Comments

@khannavin
Copy link

Running below cmd on Ubuntu:
root@vagrant:~/cloud-reports# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu

root@vagrant:~/cloud-reports#

root@vagrant:~/cloud-reports# npm run scan -- --profile aws_infra -m s3

cloud-reports@1.6.2 scan /root/cloud-reports
node dist/scan.js "--profile" "aws_infra" "-m" "s3"

(node:15063) UnhandledPromiseRejectionWarning: Error: Exited with code 3
at ChildProcess.cp.once.code (/root/cloud-reports/node_modules/opn/index.js:85:13)
at Object.onceWrapper (events.js:286:20)
at ChildProcess.emit (events.js:198:13)
at ChildProcess.EventEmitter.emit (domain.js:448:20)
at maybeClose (internal/child_process.js:982:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:198:13)
at Socket.EventEmitter.emit (domain.js:448:20)
at Pipe._handle.close (net.js:607:12)
(node:15063) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15063) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TypeError: Cannot read property 'newPage' of undefined
at createPDF (/root/cloud-reports/dist/reporters/pdf/index.js:52:36)
at process._tickCallback (internal/process/next_tick.js:68:7)

@khannavin
Copy link
Author

Just want to make sure, I can access AWS resources with same settings:
root@vagrant:/cloud-reports# aws s3 ls
2019-01-23 02:23:29 db-mysqldump
root@vagrant:
/cloud-reports#

@paragpoddar
Copy link
Member

We have modified the code. Could you please try again?
git pull
npm run build
npm run scan -- --profile aws_infra -m s3

@khannavin
Copy link
Author

root@vagrant:/cloud-reports# git pull
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (42/42), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 30 (delta 20), reused 30 (delta 20), pack-reused 0
Unpacking objects: 100% (30/30), done.
From https://github.com/tensult/cloud-reports
efe5f2c..14a1b40 master -> origin/master
Updating efe5f2c..14a1b40
Fast-forward
package-lock.json | 2 +-
package.json | 2 +-
src/reporters/pdf/html.ts | 1 +
src/reporters/pdf/partials/detailed.ejs | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
root@vagrant:
/cloud-reports# npm run build

cloud-reports@1.6.4 build /root/cloud-reports
npm install && npm run copy-ejs && tsc && cd src/reporters/html && npm install && npm run ng build -- --prod && cd ../../..

npm WARN lifecycle cloud-reports@1.6.4~prepare: cannot run in wd cloud-reports@1.6.4 npm run compile && npm run copy-ejs (wd=/root/cloud-reports)
npm WARN cloud-reports@1.6.4 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 7699 packages in 4.607s
found 324 low severity vulnerabilities
run npm audit fix to fix them, or npm audit for details

cloud-reports@1.6.4 copy-ejs /root/cloud-reports
gulp copy-ejs

[15:29:44] Using gulpfile ~/cloud-reports/gulpfile.js
[15:29:44] Starting 'copy-ejs'...
[15:29:49] Finished 'copy-ejs' after 4.4 s
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 39611 packages in 7.752s
found 1604 vulnerabilities (1592 low, 5 moderate, 7 high)
run npm audit fix to fix them, or npm audit for details

cloud-reports-final-report@0.1.0 ng /root/cloud-reports/src/reporters/html
ng "build" "--prod"

Date: 2020-03-13T15:31:17.783Z
Hash: 232bd368e2b69538b095
Time: 56966ms
chunk {0} runtime.26209474bfa8dc87a77c.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main.678295a97373c65ca83d.js (main) 717 kB [initial] [rendered]
chunk {2} polyfills.b0e7e03bbf2b4f0aa952.js (polyfills) 61.8 kB [initial] [rendered]
chunk {3} styles.30386fc5b3851deaba9d.css (styles) 55.8 kB [initial] [rendered]
root@vagrant:~/cloud-reports# npm run scan -- --profile aws_infra -m s3

cloud-reports@1.6.4 scan /root/cloud-reports
node dist/scan.js "--profile" "aws_infra" "-m" "s3"

(node:32269) UnhandledPromiseRejectionWarning: Error: Exited with code 3
at ChildProcess.cp.once.code (/root/cloud-reports/node_modules/opn/index.js:85:13)
at Object.onceWrapper (events.js:286:20)
at ChildProcess.emit (events.js:198:13)
at ChildProcess.EventEmitter.emit (domain.js:448:20)
at maybeClose (internal/child_process.js:982:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:198:13)
at Socket.EventEmitter.emit (domain.js:448:20)
at Pipe._handle.close (net.js:607:12)
(node:32269) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:32269) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TypeError: Cannot read property 'newPage' of undefined
at createPDF (/root/cloud-reports/dist/reporters/pdf/index.js:52:36)
at process._tickCallback (internal/process/next_tick.js:68:7)

@khannavin
Copy link
Author

Any updates?

@koladilip
Copy link
Contributor

Look like having issues with PDF formating, please try with -f html for html output.

@khannavin
Copy link
Author

Thanks, Dilip.

Even HTML failed. However, I am able to create csv report.

Is this tool looking for any basic package for pdf and HTML?

root@vagrant:~/cloud-reports# npm run scan -- --profile aws_infra -m s3 -f csv

> cloud-reports@1.6.4 scan /root/cloud-reports
> node dist/scan.js "--profile" "aws_infra" "-m" "s3" "-f" "csv"

./scan_report_665095561748_2020-03-17-01-06-47.csv is generated

@koladilip
Copy link
Contributor

koladilip commented Mar 17, 2020 via email

@khannavin
Copy link
Author

Hi Dilip,

I am running the script from vagrant based Ubuntu only.

Let me try to run the script from MacOS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants