How-To

XX000 Tenant or user not found: Customer.io to Supabase fix

The Supabase pooler returns "XX000 - Tenant or user not found: query failed" when it can't match your login to a project. Set the username to postgres.{your-project-ref}, not plain postgres, and copy the pooler host and port from your project's connection settings. Test the string in psql first.

Sohail HussainSohail Hussain8 min read

Short answer

  • On Supabase's pooler the database user must be postgres.{your-project-ref}, not plain postgres. Without the project reference, the pooler cannot tell which project you mean.
  • Copy the host, port and user from the Connect dialog in your Supabase dashboard instead of building them by hand, then test the string with psql before you re-enter it in Customer.io.

You set up a Customer.io data warehouse or database connection against Supabase's transaction pooler, and the login failed with this message:

XX000 - Tenant or user not found: query failed

This is a Supabase connection problem. It is not a Customer.io bug, and it is not an email deliverability problem. The same string shows up in any client that reaches the pooler with the wrong username or the wrong host.

Why it happens

XX000 is the PostgreSQL SQLSTATE for internal errors. It is a generic bucket, so the code itself tells you very little; the text after it is what matters. Supabase's pooler (Supavisor) serves many projects from a shared host, and it reads the project reference out of the username to route your connection. If the reference is missing, mistyped, or belongs to a project that is not on that host, it answers "Tenant or user not found."

Common causes, most frequent first:

  1. The username is plain postgres instead of postgres.{project-ref}.
  2. The host was assembled by hand and has the wrong region or cluster prefix.
  3. The project reference belongs to another project (staging versus production is a classic mix-up).
  4. The project is paused, so there is nothing for the pooler to route to.
  5. A stray space or hidden character came along when the username was pasted.

A wrong password normally produces a different failure (password authentication failed). If you see the tenant error, fix the username, host and project reference before touching the password.

CauseSymptomFix
Plain postgres user on the poolerTenant or user not foundUse postgres.{project-ref}
Hand-built pooler hostSame error, even with the right userCopy the host from the dashboard
Reference from another projectSame errorCompare against your project URL
Paused projectSame error or connection failureRestore the project in the dashboard
Wrong passwordpassword authentication failedReset or re-enter the password

Step-by-step fixes

Fix 1: use the pooler username format

Direct connections use postgres. Pooler connections add the project reference as a suffix.

SettingDirect connectionPooler connection
Hostdb.{project-ref}.supabase.cothe pooler host shown in your dashboard
Port54326543 (transaction mode) or 5432 (session mode)
Userpostgrespostgres.{project-ref}
Databasepostgrespostgres

The project reference is the short string in your project URL. For https://abcdefghijklmnop.supabase.co, it is abcdefghijklmnop, so the username becomes:

postgres.abcdefghijklmnop
  1. Open the connection settings in Customer.io.
  2. Enter the whole value, including the dot, in the username field.
  3. If Customer.io shows separate fields, put the full dotted string in the user field only.

Fix 2: copy the host from the dashboard

The pooler hostname includes a region and a cluster prefix, and the prefix is not the same for every project. A host that works for one project can return this same error for another.

  1. Open your project in the Supabase dashboard.
  2. Click Connect and choose the transaction pooler option.
  3. Copy the host, port and user exactly as shown.

Dashboard labels change from time to time. If you don't see Connect, look for "Connection string" or "Database settings".

A complete string looks like this:

postgresql://postgres.{project-ref}:{your-password}@{pooler-host}:6543/postgres

Tip

Copy the whole connection string into a scratch file first, then split it into host, port, user and password. That way you never retype the project reference.

Fix 3: check the project reference

Compare the reference in the username with the one in your project URL, character by character. Also confirm the project is not paused in the dashboard; a paused project cannot accept pooler connections.

Fix 4: test the connection outside Customer.io

Before changing anything in Customer.io again, prove the string works from your own machine:

psql "postgresql://postgres.{project-ref}:{your-password}@{pooler-host}:6543/postgres" -c "select 1;"

If this returns a row, the credentials are right and the problem is how Customer.io received them. If it returns the same error, the username, host or project reference is still wrong.

If psql works but Customer.io still fails

Work through these in order:

  1. Re-type the username by hand rather than pasting it, in case a hidden character came along.
  2. Check the password for special characters. If the integration takes a connection URL rather than separate fields, characters such as @, :, / and # must be percent-encoded. Separate fields usually don't need encoding.
  3. Try session mode on the pooler (port 5432 with the same postgres.{project-ref} user). Transaction mode doesn't support prepared statements, and some tools use them. That produces a different error, but it is the next thing you may hit once login works.
  4. Consider the direct connection. It uses plain postgres and the db. host, so it avoids this error entirely. Direct connections have been IPv6-only by default on Supabase unless you add the IPv4 option, so a service that can only reach IPv4 hosts may fail to connect. That is a common reason people end up on the pooler. Check Supabase's current documentation for your project's setup.

Password handling

Never paste the database password into a support ticket or a chat. Send the host, port, username format and the exact error text instead.

Checklist before you try again

  • The username is postgres.{project-ref}, with the dot, and no trailing space.
  • The host was copied from the Connect dialog, not built by hand.
  • The port matches the mode: 6543 for transaction, 5432 for session.
  • The project reference matches the project you actually mean (staging or production).
  • The project is active, not paused.
  • psql with the same values returns a row.

How to avoid it next time

  • Store the full pooler string in your password manager the moment you copy it, with the project reference visible.
  • Keep one connection note per environment, labeled staging or production.
  • Create a dedicated database role for Customer.io with only the access it needs. On the pooler, that role's username also takes the suffix, for example customerio.{project-ref}.
  • Reset the database password only when you must, and update every integration that uses it afterward.

People on Supabase's community forum report this same error from Customer.io setups, and the cause there was the missing project reference in the username.

If nothing works

If psql fails with the same error even with a host copied from the dashboard, the issue is on the Supabase side, so contact Supabase support. If psql succeeds but Customer.io rejects the same values, contact Customer.io support. Include the exact error text, the time of the attempt (with timezone), the host and port, the username format you used, and what you already tried. Leave the password out.

Subject: XX000 - Tenant or user not found: query failed (pooler login)

Hi, I'm connecting to my Supabase project through the transaction pooler
and get this error:

XX000 - Tenant or user not found: query failed

Time of attempt: {date, time, timezone}
Host: {pooler-host}
Port: 6543
Username format: postgres.{project-ref}
Project ref: {project-ref}

I already checked that the project is active and that the same values
connect from psql: {yes/no}. Can you confirm whether the pooler recognizes
this tenant, or how the integration should format the username?

Common questions

Is XX000 a Customer.io error or a Supabase error?

It comes from the Supabase pooler and is passed through by whatever client connects, so Customer.io is only displaying it.

Do I need the pooler at all?

Not if your service can reach the direct db. host, which uses plain postgres. The pooler is mainly useful when IPv6 direct access is a problem or when you need connection pooling.

Should I use port 6543 or 5432 on the pooler?

6543 is transaction mode and 5432 is session mode. Both need the postgres.{project-ref} username; pick session mode if your tool relies on prepared statements.

Does a wrong password cause this error?

Normally not; a wrong password gives password authentication failed. Check the username, host and project reference first.

strategycustomer-io-to-supabaseerror-codes
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free