dongxie3701 2019-06-20 14:18
浏览 112

Symfony 4 with doctrine:警告:发送QUERY数据包时出错。 PID = 2989

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)
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 永磁型步进电机PID算法
    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥200 uniapp长期运行卡死问题解决
    • ¥15 latex怎么处理论文引理引用参考文献
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?