[Fixed]-Peer authentication fails with PostgreSQL in celery task

1đź‘Ť

âś…

It looks like your pg_hba.conf is set to use peer authentication for local socket connections, meaning you can only connect as the Postgres user “chris” if you’re logged in as the Linux user “chris”. Your app is presumably using an IP connection rather than a socket connection, and will be subject to different authentication rules.

You could solve this by either:

  • Running Celery as user “chris”
  • Changing pg_hba.conf to use some form of password authentication for this particular user and connection type
  • Configuring Celery to use an IP connection, by setting “host” to “127.0.0.1”
👤Nick Barnes

Leave a comment