-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch wrong credentials for pSQL #6422
Comments
Should config fallback to use the JSON driver with a specified message sent to the bot owner(s) if postgres credentials are wrong? |
I would think not, as that would be an entirely separate set of data. I would say not being able to load its data because the credentials are incorrect should cause the bot to exit with the "configuration error" status code (78). Red-DiscordBot/redbot/core/_cli.py Line 26 in 30058c0
Though I am curious how we handle the database not running when the bot starts. This can probably be handled in a similar way to that as well. |
Does Red initially tries to connect to postgres when starting the bot, or does it only connect individually to postgres when a cog uses Config? |
is there like any "first guaranteed call to postgres" when Red initially starts when using the postgres driver? |
Red-DiscordBot/redbot/__main__.py Lines 300 to 315 in 30058c0
Red-DiscordBot/redbot/core/_drivers/postgres/postgres.py Lines 42 to 47 in 30058c0
Currently the pool is created in |
Shouldn't this also be handled when lets say the creds changed during runtime? |
That sounds like a very specific edge case. Credentials don't normally change during runtime. So in my opinion its fine to skip over it. |
The database going offline during runtime is a less rare edge case than the credentials changing, and both would be handled similarly, so I don't think it's unreasonable to consider. That being said, it's less clear where it would be best to catch these errors during runtime, and it's less likely to be an issue than not configuring the connection correctly at the start. I'd say that handling these on bot start is much more important, and should be the main focus for someone working on this issue. Catching similar errors during runtime wouldn't hurt, but I think is lower priority. |
The fact that no one caught this after all these years... is kinda funny!
The text was updated successfully, but these errors were encountered: