Field 'email' doesn't have a default with connection pool in MySQL

[next-auth][error][adapter_error_createUser]
https://next-auth.js.org/errors#adapter_error_createuser Field 'email' doesn't have a default value {
message: "Field 'email' doesn't have a default value",
stack: "Error: Field 'email' doesn't have a default value\n" +
' at PromisePool.query (/app/node_modules/.pnpm/mysql2@3.9.2/node_modules/mysql2/promise.js:356:22)\n' +
' at MySql2PreparedQuery.execute (file:///app/node_modules/.pnpm/drizzle-orm@0.30.8_@planetscale+database@1.11.0_@types+react@18.2.37_mysql2@3.9.2_react@18.2.0/node_modules/drizzle-orm/mysql2/session.js:48:21)\n' +
' at QueryPromise.execute (file:///app/node_modules/.pnpm/drizzle-orm@0.30.8_@planetscale+database@1.11.0_@types+react@18.2.37_mysql2@3.9.2_react@18.2.0/node_modules/drizzle-orm/mysql-core/query-builders/insert.js:90:27)\n' +
' at QueryPromise.then (file:///app/node_modules/.pnpm/drizzle-orm@0.30.8_@planetscale+database@1.11.0_@types+react@18.2.37_mysql2@3.9.2_react@18.2.0/node_modules/drizzle-orm/query-promise.js:21:17)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)',
name: 'Error'
}
[next-auth][error][adapter_error_createUser]
https://next-auth.js.org/errors#adapter_error_createuser Field 'email' doesn't have a default value {
message: "Field 'email' doesn't have a default value",
stack: "Error: Field 'email' doesn't have a default value\n" +
' at PromisePool.query (/app/node_modules/.pnpm/mysql2@3.9.2/node_modules/mysql2/promise.js:356:22)\n' +
' at MySql2PreparedQuery.execute (file:///app/node_modules/.pnpm/drizzle-orm@0.30.8_@planetscale+database@1.11.0_@types+react@18.2.37_mysql2@3.9.2_react@18.2.0/node_modules/drizzle-orm/mysql2/session.js:48:21)\n' +
' at QueryPromise.execute (file:///app/node_modules/.pnpm/drizzle-orm@0.30.8_@planetscale+database@1.11.0_@types+react@18.2.37_mysql2@3.9.2_react@18.2.0/node_modules/drizzle-orm/mysql-core/query-builders/insert.js:90:27)\n' +
' at QueryPromise.then (file:///app/node_modules/.pnpm/drizzle-orm@0.30.8_@planetscale+database@1.11.0_@types+react@18.2.37_mysql2@3.9.2_react@18.2.0/node_modules/drizzle-orm/query-promise.js:21:17)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)',
name: 'Error'
}
Im getting this error since switching to a connection pool from single connection. This happens when creating a new user in my app with next-auth. I tried changing to connection pool because I kept getting the " Can't add new command when connection is in closed state. " when leaving the app open for a while, as others mentioned before. Using normal Mysql (despite the logs mentioning planetscale -Im not using planetscale) For some reason this is not happening when running locally, only on prod. Does somebody know what this is ?
migs
migs28d ago
Fixed it. I had a custom scope on next auth for discord that was missing the email scope. Removed it so it uses the default scopes