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

Issue with genCredentials.js and db access #2

Open
johnnienuggs opened this issue Sep 8, 2017 · 2 comments
Open

Issue with genCredentials.js and db access #2

johnnienuggs opened this issue Sep 8, 2017 · 2 comments

Comments

@johnnienuggs
Copy link

I'm setting this up in a lab, and I've run into an issue at step 12 in the readme. When executing genCredentials.js, it errors out with the following, implying that there is a credential error with the user "sdp_controller@localhost". As you can see, I am not prompted for an ID or PW. I've attempted to read the js file but am unable to see what password the script may be trying to use to access the sdp database. Can you provide any insight into the credentials in the script so I can match them in the database? Thank you.

user@SDPGW1:/SDPcontroller$ node ./genCredentials.js 101
Preparing to generate credentials for SDP ID 101
Error connecting to database: Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'sdp_controller'@'localhost' (using password: YES)
user@SDPGW1:/SDPcontroller$

@SaltedTech
Copy link

I'm having an issue with the same step, but likely a different issue:
Preparing to generate credentials for SDP ID NaN Query returned error: Error: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'where clause' Error: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'where clause' at Query.Sequence._packetToError (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14) at Query.ErrorPacket (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/sequences/Query.js:79:18) at Protocol._parsePacket (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/Protocol.js:291:23) at Parser._parsePacket (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/Parser.js:433:10) at Parser.write (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/Parser.js:43:10) at Protocol.write (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/Protocol.js:38:16) at Socket.<anonymous> (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/Connection.js:88:28) at Socket.<anonymous> (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/Connection.js:526:10) at Socket.emit (events.js:315:20) at addChunk (_stream_readable.js:295:12) -------------------- at Protocol._enqueue (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/Protocol.js:144:48) at PoolConnection.query (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/Connection.js:198:25) at /home/jholland/SDPController/SDPcontroller/genCredentials.js:136:20 at Handshake.onConnect (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/Pool.js:64:7) at Handshake.<anonymous> (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/Connection.js:526:10) at Handshake._callback (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/Connection.js:488:16) at Handshake.Sequence.end (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24) at Handshake.Sequence.OkPacket (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/sequences/Sequence.js:92:8) at Protocol._parsePacket (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/Protocol.js:291:23) at Parser._parsePacket (/home/jholland/SDPController/SDPcontroller/node_modules/mysql/lib/protocol/Parser.js:433:10) { code: 'ER_BAD_FIELD_ERROR', errno: 1054, sqlMessage: "Unknown column 'NaN' in 'where clause'", sqlState: '42S22', index: 0, sql: 'SELECT * FROM sdpidWHEREsdpid= NaN' }

@takahiro-ono
Copy link

Credentials to access the database can be specified in config.js.
In config.js, you can customize parameters like dbHost, dbUser, dbPassword, and dbName.

I tested with my environment, and I found that the current implementation accepts only digits for SDP ID.
When I give non-digits to genCredentials.js like below, it behave as if the given SDP ID was NaN.
It seems that the error handling after parseInt is not working.

node ./genCredentials.js abc

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

3 participants