tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.65k stars 512 forks source link

运行一会,就会中断,提示截图显示的错误 #591

Closed renkx closed 2 years ago

renkx commented 2 years ago

Describe the bug 运行一会,就会中断,提示截图显示的错误

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: Command queue state error. If you can reproduce this, please report it. Last error: ERR read tcp 10.0.5.7:6379->10.0.0.3:60634: i/o timeout
    at DataHandler.shiftCommand (/usr/local/share/.config/yarn/global/node_modules/ioredis/built/DataHandler.js:164:27)
    at DataHandler.returnError (/usr/local/share/.config/yarn/global/node_modules/ioredis/built/DataHandler.js:33:27)
    at JavascriptRedisParser.returnError (/usr/local/share/.config/yarn/global/node_modules/ioredis/built/DataHandler.js:15:22)
    at JavascriptRedisParser.execute (/usr/local/share/.config/yarn/global/node_modules/redis-parser/lib/parser.js:542:14)
    at Socket.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/ioredis/built/DataHandler.js:25:20)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Emitted 'error' event on Redis instance at:
    at DataHandler.shiftCommand (/usr/local/share/.config/yarn/global/node_modules/ioredis/built/DataHandler.js:168:24)
    at DataHandler.returnError (/usr/local/share/.config/yarn/global/node_modules/ioredis/built/DataHandler.js:33:27)
    [... lines matching original stack trace ...]
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
image

配置文件:

{
  "apiOriginAllow": {
    "allowCors": true,
    "allowOrigin": "*",
    "allowMethods": "GET, POST",
    "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
  },
  "authEndpoint": "/api/admin/broadcasting/auth",
  "authHost": "http://api",
  "clients": [
    {
      "appId": "e4ad8ca7e****",
      "key": "aca3024bebc1d0978d2759****"
    }
  ],
  "database": "redis",
  "databaseConfig": {
    "redis": {
      "host": "redis-*****.jvessel-open-hb.jdcloud.com",
      "port": "6379",
      "keyPrefix": "api_ec_database_",
      "password": "*****",
      "options": {
        "db": "0"
      }
    },
    "sqlite": {
      "databasePath": "/database/laravel-echo-server.sqlite"
    },
    "publishPresence": true
  },
  "devMode": true,
  "host": "api-ws",
  "port": 6003,
  "protocol": "http",
  "sslCertPath": "",
  "sslKeyPath": "",
  "sslCertChainPath": "",
  "sslPassphrase": "",
  "socketio": {
    "path": "/op.socket.io"
  },
  "subscribers": {
    "http": true,
    "redis": false
  }
}

redis_version:4.0.14

clezeraragon commented 2 years ago

your problem is in the dependency of one and the development of that package has been stopped Logging : Installing packages...npm WARN deprecated request@2.88.2: request

renkx commented 2 years ago

找到原因了,是因为redis的timeout设置导致的