jianyan74 / rageframe2

一个基于 Yii2 高级框架的快速开发应用引擎
http://www.rageframe.com
Apache License 2.0
1.7k stars 583 forks source link

基于此项目开发的平台和线下机器交互报错 mb_strlen() expects parameter 1 to be string, array given #92

Closed zhaobing45 closed 3 years ago

zhaobing45 commented 4 years ago
使用rageframe2框架加swoole开发的平台和线下机器交互,线下机器会向服务器推送数据。线下机器在每天会在夜里2点钟定时重启,重启之后就无法与服务器连接,报错 “mb_strlen() expects parameter 1 to be string, array given”,必须手动重启swoole。以下是错误日志:

2020-09-27 02:01:10 修改fd信息:-----mb_strlen() expects parameter 1 to be string, array given^M 2020-09-27 02:01:10 修改fd信息:-----mb_strlen() expects parameter 1 to be string, array given^M 2020-09-27 02:01:10 修改fd信息:-----mb_strlen() expects parameter 1 to be string, array given^M 2020-09-27 02:01:10 yii\db\Exception Object ( [errorInfo] => Array ( )

[message:protected] => Received illegal data from redis: ated_at

Redis command was: EVAL local allpks=redis.call('LRANGE','cabinet_fd',0,-1) local pks={} local n=0 local v=nil local i=0 local key='cabinet_fd' for k,pk in ipairs(allpks) do local cfd0=redis.call('HGET','cabinet_fd' .. ':a:' .. pk, 'fd')

if cfd0=='146' then
  i=i+1
  if i>0 then
    do return redis.call('HGETALL','cabinet_fd:a:' .. pk) end
  end
end

end return pks 0 [string:Exception:private] => [code:protected] => 0 [file:protected] => /www/wwwroot/power/vendor/yiisoft/yii2-redis/src/Connection.php [line:protected] => 856 [trace:Exception:private] => Array ( [0] => Array ( [file] => /www/wwwroot/power/vendor/yiisoft/yii2-redis/src/Connection.php [line] => 851 [function] => parseResponse [class] => yii\redis\Connection [type] => -> [args] => Array ( [0] => Array ( [0] => EVAL [1] => local allpks=redis.call('LRANGE','cabinet_fd',0,-1) local pks={} local n=0 local v=nil local i=0 local key='cabinet_fd' for k,pk in ipairs(allpks) do local cfd0=redis.call('HGET','cabinet_fd' .. ':a:' .. pk, 'fd')

if cfd0=='146' then
  i=i+1
  if i>0 then
    do return redis.call('HGETALL','cabinet_fd:a:' .. pk) end
  end
end

end return pks [2] => 0 )

                    )

            )

        [1] => Array
            (
                [file] => /www/wwwroot/power/vendor/yiisoft/yii2-redis/src/Connection.php
                [line] => 851
                [function] => parseResponse
                [class] => yii\redis\Connection
                [type] => ->
                [args] => Array
                    (
                        [0] => Array
                            (
                                [0] => EVAL
                                [1] => local allpks=redis.call('LRANGE','cabinet_fd',0,-1)

local pks={} local n=0 local v=nil local i=0 local key='cabinet_fd' for k,pk in ipairs(allpks) do local cfd0=redis.call('HGET','cabinet_fd' .. ':a:' .. pk, 'fd')

if cfd0=='146' then
  i=i+1
  if i>0 then
    do return redis.call('HGETALL','cabinet_fd:a:' .. pk) end
  end
end

end return pks [2] => 0 )

                    )

            )

        [2] => Array
            (
                [file] => /www/wwwroot/power/vendor/yiisoft/yii2-redis/src/Connection.php
                [line] => 796
                [function] => parseResponse
                [class] => yii\redis\Connection
                [type] => ->
                [args] => Array
                    (
                        [0] => Array
                            (
                                [0] => EVAL
                                [1] => local allpks=redis.call('LRANGE','cabinet_fd',0,-1)

local pks={} local n=0 local v=nil local v=nil local i=0 local key='cabinet_fd' for k,pk in ipairs(allpks) do local cfd0=redis.call('HGET','cabinet_fd' .. ':a:' .. pk, 'fd')

if cfd0=='146' then
  i=i+1
  if i>0 then
    do return redis.call('HGETALL','cabinet_fd:a:' .. pk) end
  end
end

end return pks [2] => 0 )

                    )

            )

        [2] => Array
            (
                [file] => /www/wwwroot/power/vendor/yiisoft/yii2-redis/src/Connection.php
                [line] => 796
                [function] => parseResponse
                [class] => yii\redis\Connection
                [type] => ->
                [args] => Array
                    (
                        [0] => Array
                            (
                                [0] => EVAL
                                [1] => local allpks=redis.call('LRANGE','cabinet_fd',0,-1)

local pks={} local n=0 local v=nil local i=0 local key='cabinet_fd' for k,pk in ipairs(allpks) do local cfd0=redis.call('HGET','cabinet_fd' .. ':a:' .. pk, 'fd')

if cfd0=='146' then
  i=i+1
  if i>0 then
    do return redis.call('HGETALL','cabinet_fd:a:' .. pk) end
  end
end

end return pks [2] => 0 )

                        [1] => *3^M

$4^M EVAL^M $371^M

zhaobing45 commented 4 years ago

经检查redis和swoole相关服务都是正常的

jianyan74 commented 3 years ago

之前测试连接redis超时就会这样子