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

Length is insufficient for 'password' column while creating DB #1

Closed
nabeelkirmani opened this issue Aug 9, 2020 · 1 comment
Closed

Comments

@nabeelkirmani
Copy link

nabeelkirmani commented Aug 9, 2020

Error Log:

Error:` ER_DATA_TOO_LONG: Data too long for column 'password' at row 1
    at Query.Sequence._packetToError (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
    at Query.ErrorPacket (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
    at Protocol._parsePacket (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/protocol/Protocol.js:291:23)
    at Parser._parsePacket (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/protocol/Parser.js:433:10)
    at Parser.write (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/protocol/Parser.js:43:10)
    at Protocol.write (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/Connection.js:88:28)
    at Socket.<anonymous> (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/Connection.js:526:10)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:303:12)
    --------------------
    at Pool.query (~/Documents/nodejs/signupForm-JS-master/node_modules/mysql/lib/Pool.js:199:23)
    at internal/util.js:297:30
    at new Promise (<anonymous>)
    at Pool.query (internal/util.js:296:12)
    at Strategy._verify (~/Documents/nodejs/signupForm-JS-master/src/lib/passport.js:73:33)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'ER_DATA_TOO_LONG',
  errno: 1406,
  sqlMessage: "Data too long for column 'password' at row 1",
  sqlState: '22001',
  index: 0,
  sql: "INSERT INTO users set `email` = 'test@email.com', `fullname` = 'test@email.com', `password` = '$2a$12$9mKxHPuT4R5GdVx4vh*h&hY4JCjtKopTNVUQx.2WBRam8UiYV/EO'"
}
There has been an error inserting the data in the DB.

Possible Fix:

From
https://github.com/SeRGiioxAG/signupForm-JS/blob/e36070dd2e31d165611375b26e873bed3ea3c105/database/db.sql#L12

Change to

password VARCHAR(256) NOT NULL,
@SergioAstudillo
Copy link
Owner

Thank you for opening the issue:
I forgot to update the db.sql file after I updated the password DB field in the dev enviroment.
If you see another problem in the app feel free to open another issue 😀😀

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

2 participants