I’m trying to change my install to use an external postgres database. I have it set up to connect to the database with a new install, which seems to work fine. But when I try and do a restore from the old internal database, I get ‘authentication failed for user “discourse”: too many failed login attempts’. It seems like its maybe not using the database information the site is configured with as the external database user is different than “discourse”. Would restore be pulling it’s config from somewhere else? Or other ideas on why this might be failing with other database connections are working?
AI-generated summary
A user is trying to restore a Discourse installation to an external PostgreSQL database hosted on Azure, but encounters an ‘authentication failed’ error during the restore process. The issue appears to stem from insufficient database permissions, despite the user having been granted privileges to create databases, schemas, and functions. Falco suggests checking if the user has superuser rights and confirms that the PostgreSQL version is 10.x. After adjusting permissions, NotAnonymous reports that the restore succeeded upon retrying, indicating the problem was likely related to permission propagation or configuration caching. Falco requests logs for further analysis, but the issue resolves itself after the user reattempts the restore NotAnonymous.
Is this a restore from the Admin web interface?
I’ve tried from web interface and from command line. Same result.
Is the user you have setup on this external instance a superuser? We will try to create schemas and functions so we need permissions that you may be missing.
Also is the PostgreSQL version 10.x ?
It’s an Azure Postgres database so I’m not able to set the user as a superuser. I tried giving the user as much privilege as I could but it still doesn’t work. It gets as far as to “Migrating the database…” and then gives the error. And yes, it’s v10.x.
So am I just out of luck if I can’t run it as a superuser? The user has permission to create databases, schemas and functions.
It should work just fine if the users has enough permissions. Just checking the basics.
Can you provide the logs from the restore attempt so we know the exact part where it explodes?
Looks like it was the permissions. Might have had to rebuild after changing them or something to get things to kick in. But just ran it again to get you logs and it worked!
Thanks for the help!