snoopysecurity / dvws-node

Damn Vulnerable Web Services is a vulnerable application with a web service and an API that can be used to learn about webservices/API related vulnerabilities.
GNU General Public License v3.0
455 stars 179 forks source link

'PROTOCOL_CONNECTION_LOST' ERROR #24

Closed sathish80j closed 2 years ago

sathish80j commented 3 years ago

'PROTOCOL_CONNECTION_LOST' error occured when creating mysql database for DVWS,pl help me to fix it,thankyou

┌──(kali㉿kali)-[~/dvws-node] └─$ node startup_script.js

[+] Creating MySQL database for DVWS.... /home/kali/dvws-node/startup_script.js:22 if (err) throw err; ^

Error: Connection lost: The server closed the connection. at Protocol.end (/home/kali/dvws-node/node_modules/mysql/lib/protocol/Protocol.js:112:13) at Socket. (/home/kali/dvws-node/node_modules/mysql/lib/Connection.js:94:28) at Socket. (/home/kali/dvws-node/node_modules/mysql/lib/Connection.js:526:10) at Socket.emit (events.js:326:22) at endReadableNT (_stream_readable.js:1241:12) at processTicksAndRejections (internal/process/task_queues.js:84:21)

at Protocol._enqueue (/home/kali/dvws-node/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/home/kali/dvws-node/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/home/kali/dvws-node/node_modules/mysql/lib/Connection.js:116:18)
at Object.<anonymous> (/home/kali/dvws-node/startup_script.js:21:12)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {

fatal: true, code: 'PROTOCOL_CONNECTION_LOST' }

snoopysecurity commented 3 years ago

Hey

yep so after running both docker commands, you need to wait 10 seconds before running node startup_script.js. It takes 10 seconds for the mysql db to start running. Just double check that your mysql db is running before running node startup_script.js

mahmoudibraheem commented 3 years ago

i have the same problem and i wait for 10s but nothing

snoopysecurity commented 2 years ago

Most likely there is something wrong with way you are running the mysql server, try using docker-compose instead (https://github.com/snoopysecurity/dvws-node#docker-compose)

mahmoudibraheem commented 2 years ago

thanks bro, it works