Jump to content

Cant make my nodejs app to work


nuxspotb

Recommended Posts

Hello, Ive uploaded my Nodejs API server to heliohost tommy, reading the wiki, but I cant make it to work. I suspect it could be some router, so I added both but it sitll wont work, I get either error 500 or 

Incomplete response received from application

I know it works because it works on my localhost, so I dont know what could go wrong besides routes, but Ive added both ( I mean adding the /node/ path to nodejs express route config ) http://nuxspot.heliohost.us/node

Edited by nuxspotb
Link to comment
Share on other sites

The reason I bring up the basic example is because the best way to troubleshoot something not working is to start with a working example and then add things to it one at a time, and test it between each change to make sure it's still working. If adding 1 line causes it to stop working then you can figure out what is wrong with that 1 line. If you change 500 things at once then it's very hard to narrow down what broke it exactly.

Link to comment
Share on other sites

I took a look at the error logs and it looks like your error is pretty simple.

 

App 102512 output: Our app is running on port 3000
App 102512 output: /home/trenderx/node/node_modules/mysql/lib/protocol/Parser.js:437
App 102512 output:       throw err; // Rethrow non-MySQL errors
App 102512 output:       ^
App 102512 output: Error: ER_DBACCESS_DENIED_ERROR: Access denied for user 'trenderx_notes'@'localhost' to database 'trenderx_nuxnotes'
App 102512 output:     at Handshake.Sequence._packetToError (/home/trenderx/node/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
App 102512 output:     at Handshake.ErrorPacket (/home/trenderx/node/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
App 102512 output:     at Protocol._parsePacket (/home/trenderx/node/node_modules/mysql/lib/protocol/Protocol.js:291:23)
App 102512 output:     at Parser._parsePacket (/home/trenderx/node/node_modules/mysql/lib/protocol/Parser.js:433:10)
App 102512 output:     at Parser.write (/home/trenderx/node/node_modules/mysql/lib/protocol/Parser.js:43:10)
App 102512 output:     at Protocol.write (/home/trenderx/node/node_modules/mysql/lib/protocol/Protocol.js:38:16)
App 102512 output:     at Socket.<anonymous> (/home/trenderx/node/node_modules/mysql/lib/Connection.js:88:28)
App 102512 output:     at Socket.<anonymous> (/home/trenderx/node/node_modules/mysql/lib/Connection.js:526:10)
App 102512 output:     at Socket.emit (events.js:198:13)
App 102512 output:     at addChunk (_stream_readable.js:288:12)
App 102512 output:     --------------------
App 102512 output:     at Protocol._enqueue (/home/trenderx/node/node_modules/mysql/lib/protocol/Protocol.js:144:48)
App 102512 output:     at Protocol.handshake (/home/trenderx/node/node_modules/mysql/lib/protocol/Protocol.js:51:23)
App 102512 output:     at Connection.connect (/home/trenderx/node/node_modules/mysql/lib/Connection.js:116:18)
App 102512 output:     at Object.<anonymous> (/home/trenderx/node/app/models/db.js:13:12)
App 102512 output:     at Module._compile (internal/modules/cjs/loader.js:778:30)
App 102512 output:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
App 102512 output:     at Module.load (internal/modules/cjs/loader.js:653:32)
App 102512 output:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
App 102512 output:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
App 102512 output:     at Module.require (internal/modules/cjs/loader.js:692:17)
Your mysql database user is getting access denied error.
Link to comment
Share on other sites

I took a look at the error logs and it looks like your error is pretty simple.

 

App 102512 output: Our app is running on port 3000
App 102512 output: /home/trenderx/node/node_modules/mysql/lib/protocol/Parser.js:437
App 102512 output:       throw err; // Rethrow non-MySQL errors
App 102512 output:       ^
App 102512 output: Error: ER_DBACCESS_DENIED_ERROR: Access denied for user 'trenderx_notes'@'localhost' to database 'trenderx_nuxnotes'
App 102512 output:     at Handshake.Sequence._packetToError (/home/trenderx/node/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
App 102512 output:     at Handshake.ErrorPacket (/home/trenderx/node/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
App 102512 output:     at Protocol._parsePacket (/home/trenderx/node/node_modules/mysql/lib/protocol/Protocol.js:291:23)
App 102512 output:     at Parser._parsePacket (/home/trenderx/node/node_modules/mysql/lib/protocol/Parser.js:433:10)
App 102512 output:     at Parser.write (/home/trenderx/node/node_modules/mysql/lib/protocol/Parser.js:43:10)
App 102512 output:     at Protocol.write (/home/trenderx/node/node_modules/mysql/lib/protocol/Protocol.js:38:16)
App 102512 output:     at Socket.<anonymous> (/home/trenderx/node/node_modules/mysql/lib/Connection.js:88:28)
App 102512 output:     at Socket.<anonymous> (/home/trenderx/node/node_modules/mysql/lib/Connection.js:526:10)
App 102512 output:     at Socket.emit (events.js:198:13)
App 102512 output:     at addChunk (_stream_readable.js:288:12)
App 102512 output:     --------------------
App 102512 output:     at Protocol._enqueue (/home/trenderx/node/node_modules/mysql/lib/protocol/Protocol.js:144:48)
App 102512 output:     at Protocol.handshake (/home/trenderx/node/node_modules/mysql/lib/protocol/Protocol.js:51:23)
App 102512 output:     at Connection.connect (/home/trenderx/node/node_modules/mysql/lib/Connection.js:116:18)
App 102512 output:     at Object.<anonymous> (/home/trenderx/node/app/models/db.js:13:12)
App 102512 output:     at Module._compile (internal/modules/cjs/loader.js:778:30)
App 102512 output:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
App 102512 output:     at Module.load (internal/modules/cjs/loader.js:653:32)
App 102512 output:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
App 102512 output:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
App 102512 output:     at Module.require (internal/modules/cjs/loader.js:692:17)
Your mysql database user is getting access denied error.

 

 

Yikes I actually tried that, so I did a new user, and probably forgot to re-add the new user to the database privileges.

 

I added the user to the database privileges again and it worked fine, thanks

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...