Ever since the move of the MariaDB database to a new host ( (10.5.22, “Mriadb Galera cluster”) I’m sometimes having issues with running queries.
$dsn="mysql:host=".$settings['DB_HOST'].";port=".$settings['DB_PORT'].";dbname=".$settings['DB_DATABASE'].";charset=utf8";
try {
$this->db = new PDO($dsn, <user>,<password>);
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
error_log('success')
} catch (PDOException $e) {
$settings[LOG_ERROR] && error_log($e->getMessage());
}
This connection is ALWAYS succesfull (the PHP log shows the “success” string)
Then I run this query:
$query = "SELECT * FROM <table> WHERE (USERNAME = ?) AND (ACTIVE=1) AND (FAILEDLOGIN<3);";
$user = $this->db->query($query, strtoupper($login));
if ($user){
$result = $user->getRow();
}
return $result;
Sometimes it returns a “None object” , then 15 minutes later it’s working fine again.
The DB admin could not find anything in the logs.
The DB server is behind “BigIP” but only for load balancing and our BigIP engineer couldn’t find anything in the logs either.
Is there any other debugging method I can use to try to find the issue?
All the articles I find in StackOverflow cover consistent issues, as far as I can see…
Because the PDO connection is working fine and the issue is sometimes fixed without any action from my or anyone else’s action, i’ve got no idea what else to try.
All the articles I find in StackOverflow cover more ‘consistent’ issues, as far as I can see…