Unable to connect to database r1 then r2