Trying to get db sync to do the initial database setup. I have this running on another ubuntu 20 box, and I trying to recreate it from scratch with all of the same versions and this time I am getting an error trying to run it

Running : migration-1-0000-20190730.sql
psql: error: fe_sendauth: no password supplied
ExitFailure 2

i know that it seems the pgpass file because when I run

PGPASSFILE=config/pgpass-mainnet scripts/postgresql-setup.sh --createdb

It recognizes the username I put in there. And the password is in there as well Here is the db sync command I am running:

PGPASSFILE=/home/user/cardano-db-sync/config/pgpass-mainnet \
  /home/user/cardano-db-sync/db-sync-node/bin/cardano-db-sync \
      --config /home/user/cardano-db-sync/config/mainnet-config.yaml \
      --socket-path /var/ada/node.socket \
      --state-dir /home/user/cardano-db-sync/ledger-state/mainnet \
      --schema-dir /home/user/cardano-db-sync/schema/ \

which results in the following response

[db-sync-node:Info:6] [2022-03-25 03:22:50.40 UTC] Schema migration files validated
[db-sync-node:Info:6] [2022-03-25 03:22:50.40 UTC] Running database migrations
[db-sync-node:Info:6] [2022-03-25 03:22:50.40 UTC] Enviroment variable DbSyncAbortOnPanic: False
ExitFailure 2

Errors in file: /tmp/migrate-2022-03-25T032250.log

and the log file is what contains the authentication error.. my pgpass looks like


I have also tried using localhost and I notice when running

PGPASSFILE=config/pgpass-mainnet psql cexplorer

it asks me to authenticate for my current user, NOT the user in the mgpass file but when running the previous command for creating db it asks me the password for the correct user in the pgpass file. Both users can log into postgres regardless and actually have the same password at the moment. Any clues would be appreciated this is with cradno-db-sync 12.0.2 the latest node release.

1 Answer 1


Sorry, this is totally a PostgreSQL setup issue and nothing at all to do with db-sync. You might get some more information by running:

PGPASSFILE=config/pgpass-mainnet scripts/postgresql-setup.sh --check

If that doesn't give you any clues I would read up on user authentication in the PostgreSQL documentation.

  • ok ty I will look into this
    – noone392
    Commented Mar 25, 2022 at 4:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.