rewanthtammana / Damn-Vulnerable-Bank

Damn Vulnerable Bank is designed to be an intentionally vulnerable android application. This provides an interface to assess your android application security hacking skills.

Home Page:https://rewanthtammana.com/damn-vulnerable-bank/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when starting the backendserver

dennismzia opened this issue · comments

I get this error when I try to start the backendserver

(node:320460) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:320460) [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.
user@Latitude:~/Damn-Vulnerable-Bank/BackendServer$
online results say its something about not adding catch blocks to where promises are used. maybe issue is depricated packages?

Hi @sirmalware , How are you trying to run the backend server? With docker or without docker? Can you please try to run it with Docker?

Backend server installation steps are mentioned here: Install Backend Server

ive tried running it with both docker-compose and npm to know avail but both give the same errors. to reproduce could you clone the current repo and try running the server would like to confirm its not just on my side. and yes I've read the instructions couple 10x times now marvelously written btw. Ive searched for solutions online and again still get the same answer of encapsulating promises in catch. probably its a new node/npm update breaking it?

I just tried it online on Katacoda. It's working for me. See the last few lines.

image

Screenshot from 2022-01-16 15-10-38
by the screenshot what could be wrong

Okay, I understood your concern. We have two docker containers as part of BackendServer.

  1. API
  2. MySQL

As mentioned here, API container depends on MySQL container.

Until MySQL server is not up, API server tries to connect with MySQL but the connection will not be successful. The API server will throw some errors. Because of it, the API server container will be terminated. A new API server container will be created immediately to retry the same request.

Just run docker-compose up --build & wait for some time. Then the MySQL container will be fully functional & so will the API server. Don't press Ctrl+C, just wait for a while.

ok. have you tried npm start locally tho?

Not required, if you are using docker.

Hi rewanthtammana,

npm start on local machine doesn't work.

You should probably take a look at this error message:

(node:53570) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

@hafiz-ng It might be an issue with the version of npm you are using. Try running it using docker. It's preferred for installation & easy to create/destroy resources. Instructions here

Thanks. I will try that.