supabase: Unable to Connect to Supabase PostgreSQL via Sequelize: SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing
I’m using Sequelize to connect to various PostgreSQL databases. The connection works for some instances but fails when trying to connect to Supabase with the following connection string:
postgresql://postgres.zzoqmftgxxbtuztxklxi:[PASSWORD]@aws-0-ap-south-1.pooler.supabase.com:6543/postgres
I receive the following error:
Unable to connect to the database: SequelizeConnectionError: SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing
Steps to Reproduce: Code: Here is the Sequelize instance creation code I’m using:
const { Sequelize } = require('sequelize');
function createSequelizeInstance(connectionURI) {
return new Sequelize(connectionURI, {
dialect: 'postgres',
dialectOptions: {
ssl: {
require: true,
rejectUnauthorized: false, // Tried both true and false here
},
},
});
}
Working connectionUri:
postgresql://vmkathe:[PASSWORD]@ep-damp-sun-a1vvdcup-pooler.ap-southeast-1.aws.neon.tech/anyname?sslmode=require
this db is provided by NeonDb
Expected Behavior: Sequelize should successfully authenticate with Supabase PostgreSQL using the provided connection string.
Actual Behavior: Authentication fails with the error SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing.
Questions: Is there any specific configuration required to authenticate with Supabase PostgreSQL when using Sequelize? Is this error related to Supabase’s authentication mechanism, or is it a bug/limitation in Sequelize’s handling of SASL/SCRAM authentication?
Any guidance on how to resolve this issue would be greatly appreciated.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 22 (7 by maintainers)
had this issue when using env vars and my password had especial characters on it. so I had to escape it
thi issue helped to solve it: https://github.com/supabase/supabase/issues/21690
hey @ryzxxn, can you try to connect to Sequelize using the 5432 port and let us know if you still have this issue? The transaction port 6543 is typically used for short-lived connections in serverless environments to execute a sequence of SQL commands as a single unit of work. For standard database connections like Sequelize, port 5432 should be used.
Also, checking your project logs there’s the following error:
Exchange error: "Wrong password" when method: auth_query. Can you double-check your credentials to make sure they’re correct?hey sorry if i missed some details out initially, the above string is giving me the issue not the one from neon DB