Reconnect of select_db fails due to an OperationalError