"{\"id\":\"1654589316.4924.670\",\"time\":1654589316,\"delay\":0,\"attempts\":6,\"queue\":\"nat_report_queue\",\"data\":{\"id\":1348431,\"user_id\":71,\"tray_id\":15551,\"tray_no\":\"0607-8-1-BS15564\",\"hole_site\":\"E5\",\"bar_name\":\"0607-8-1-BS15564-37\",\"bar_code\":\"11033074453206\",\"result\":1,\"is_recheck\":0,\"remark\":\"\",\"status\":5,\"create_time\":\"2022-06-07 10:16:52\",\"update_time\":\"2022-06-07 10:16:52\",\"check_time\":\"2022-06-07 15:34:06\",\"orf1ab\":\"NoCt\",\"n\":\"NoCt\",\"ic\":\"26.09\",\"api_type\":0,\"api_code\":null,\"api_msg\":null,\"up_status\":1,\"up_time\":null,\"rule_id\":0,\"rule_code\":\"0_0_1\",\"result_text\":\"\u9634\u6027\",\"is_positive\":0,\"import_bar_code\":\"11033074453206\",\"is_audit\":1},\"error\":\"Error: Call to a member function sessionId() on null in \/data\/wwwroot\/lims-admin\/app\/functions.php:44\nStack trace:\n#0 \/data\/wwwroot\/lims-admin\/app\/admin\/api\/Nat.php(37): api_curl()\n#1 \/data\/wwwroot\/lims-admin\/app\/admin\/api\/Nat.php(58): app\\admin\\api\\Nat->getToken()\n#2 \/data\/wwwroot\/lims-admin\/app\/queue\/redis\/NatReportConsumer.php(26): app\\admin\\api\\Nat->reportResult()\n#3 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/redis-queue\/src\/Client.php(218): app\\queue\\redis\\NatReportConsumer->consume()\n#4 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/redis\/src\/Client.php(422): Workerman\\RedisQueue\\Client->Workerman\\RedisQueue\\{closure}()\n#5 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Connection\/TcpConnection.php(638): Workerman\\Redis\\Client->Workerman\\Redis\\{closure}()\n#6 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Events\/Select.php(295): Workerman\\Connection\\TcpConnection->baseRead()\n#7 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Worker.php(2431): Workerman\\Events\\Select->loop()\n#8 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Worker.php(1555): Workerman\\Worker->run()\n#9 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Worker.php(1397): Workerman\\Worker::forkOneWorkerForLinux()\n#10 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Worker.php(1371): Workerman\\Worker::forkWorkersForLinux()\n#11 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Worker.php(1692): Workerman\\Worker::forkWorkers()\n#12 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Worker.php(1641): Workerman\\Worker::monitorWorkersForLinux()\n#13 \/data\/wwwroot\/lims-admin\/vendor\/workerman\/workerman\/Worker.php(551): Workerman\\Worker::monitorWorkers()\n#14 \/data\/wwwroot\/lims-admin\/start.php(112): Workerman\\Worker::runAll()\n#15 {main}\"}"
通过lrange {redis-queue}-failed 0 0 查看里面有一个 Call to a member function sessionId() on null报错
但是在那个方法里第44行明明不是request()->sessionId() 这个是在第41行。
如下图所示:
可能是之前是第40行,后面改了代码行数变了,没reload加载新代码,导致内存里的代码还是老代码,所以报错在44行。
看起来是消费环境无法使用 request()->sessionId(),消费环境没有请求,request()是null。
我重新stop后在start的,应该不是这个问题。还有就是我里面有删除key的操作。有些key删除不了。本地环境没有遇到过这个问题。生产环境有,会不会是redis版本问题?
还有本地环境或者测试环境不要连线上正式redis,不然本地调试啥的可能消费了线上的数据,然后本地代码临时加了var_dump啥的更改了行数,导致报错和线上代码行数不一致。
最基本的删除应该不会有redis版本兼容问题吧。
本地跟线上是一致的。这个我刚确认过了,就是redis的版本不是一样的。
消费失败 在redis有详细提示