File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -903,7 +903,23 @@ async def validate_database_connection(self):
903
903
except Exception as exc :
904
904
logger .critical (error ('Something went wrong '
905
905
'while connecting to the database.' ))
906
- logger .critical (error (f'{ type (exc ).__name__ } : { str (exc )} ' ))
906
+ message = f'{ type (exc ).__name__ } : { str (exc )} '
907
+ logger .critical (error (message ))
908
+
909
+ if 'ServerSelectionTimeoutError' in message :
910
+ logger .critical (error (
911
+ "This may have been caused by not whitelisting "
912
+ "IPs correctly. Make sure to whitelist all "
913
+ "IPs (0.0.0.0/0) https://i.imgur.com/mILuQ5U.png"
914
+ ))
915
+
916
+ if 'OperationFailure' in message :
917
+ logger .critical (error ("This is due to having invalid credentials in your MONGO_URI." ))
918
+ logger .critical (error (
919
+ "Recheck the username/password and make sure to url encode them. "
920
+ "https://www.urlencoder.io/"
921
+ ))
922
+
907
923
return await self .logout ()
908
924
else :
909
925
logger .info (info ('Successfully connected to the database.' ))
You can’t perform that action at this time.
0 commit comments