I have a TCP socket listener to receive data inside a Symfony 4 Command. When I receive data, I process the data trying to find a Entity (from Database).
I am able to receive several data from TCP and run all my code without issues. But suddenly, the following error appears:
In DBALException.php line 172:
An exception occurred while executing 'SELECT t0.id AS id_1, t0.name AS name_2, t0.serialnumber AS serialnumber_3,
t0.location AS location_4, t0.latitude AS latitude_5, t0.longitude AS longitude_6, t0.host AS host_7, t0.port AS po
rt_8, t0.enabled AS enabled_9, t0.mac_address AS mac_address_10, t0.camera_model_id AS camera_model_id_11 FROM devi
ce t0 WHERE t0.mac_address = ? LIMIT 1' with params ["58:03:fb:a2:46:6c"]:
Warning: Error while sending QUERY packet. PID=2989
In PDOStatement.php line 117:
Warning: Error while sending QUERY packet. PID=2989
I have a Debian 9 server, running PHP 7.3, MariaDB and Apache 2.
I have search and I have found several posts but none of the solutions worked:
- Increase the value of 'wait_timeout' to 28800.
- Increase the value of 'max_allowed_packet' to 536870912.
It fails when I call:
$device = $this->deviceRepository->findOneBy(array('macAddress' => (string)$xml->macAddress));
MARIADB shows:
MariaDB [database]> SHOW GLOBAL VARIABLES LIKE "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 10 |
+---------------+-------+
1 row in set (0.001 sec)
MariaDB [database]> SHOW GLOBAL VARIABLES LIKE "max_allowed_packet";
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 536870912 |
+--------------------+-----------+
1 row in set (0.001 sec)