无法建立因未捕获异常而断开的 websocket 连接:错误 [ERR_IPC_CHANNEL_CLOSED]:通道已关闭

如何解决无法建立因未捕获异常而断开的 websocket 连接:错误 [ERR_IPC_CHANNEL_CLOSED]:通道已关闭?

开发过程中遇到无法建立因未捕获异常而断开的 websocket 连接:错误 [ERR_IPC_CHANNEL_CLOSED]:通道已关闭的问题如何解决?下面主要结合日常开发的经验,给出你关于无法建立因未捕获异常而断开的 websocket 连接:错误 [ERR_IPC_CHANNEL_CLOSED]:通道已关闭的解决方法建议,希望对你解决无法建立因未捕获异常而断开的 websocket 连接:错误 [ERR_IPC_CHANNEL_CLOSED]:通道已关闭有所启发或帮助;

问题描述

我的环境详情:

  • 操作系统:Ubuntu 20.04
  • 节点版本:9.6.1
  • Qt 版本:5.9.1

使用名为 JavaScriptAPP 构建前端应用程序。 APP接收客户端的请求,并与负责创建worker的browser Service(一个node Js服务)建立websocket连接。browser Service在过程使用了一些原生的依赖(用c++编写)。架构如下:

enter image description here

我可以毫无问题地启动所有服务。当我尝试创建进程时,它失败并显示以下错误

Using browser engine:  webkit
[2021-03-19 11:34:27.042] [INFO] browser_service/src/routes/session.Js - [MASTER: 16688] Worker done [pID: 20764,exit:0 SIGSEGV]
[2021-03-19 11:34:27.042] [INFO] browser_service/src/routes/session.Js - [MASTER: 16688] Unbound socket for worker [PID: 20764,ID: browserRemote-1616148965600]
[2021-03-19 11:34:27.042] [INFO] browser_service/src/routes/session.Js - [MASTER: 16688] Worker disconnected (server namespace disconnect),starting self-destruct timeout to a few seconds from Now [pID: 20764,ID: browserRemote-1616148965600]
payload server namespace disconnect
[2021-03-19 11:34:27.042] [ERROR] browser_service/index.Js - [MASTER: 16688] Uncaught exception:  Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.Js:596:16)
    at unbinDWorker (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:76:24)
    at Socket.socketdisconnectHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:26:13)
    at Socket.emit (events.Js:132:15)
    at Socket.emit (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:128:10)
    at Socket.onclose (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:425:8)
    at Socket.disconnect (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:453:10)
    at ChildProcess.workerExitHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:53:27)
    at ChildProcess.emit (events.Js:127:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.Js:209:12)
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.Js:596:16)
    at unbinDWorker (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:76:24)
    at Socket.socketdisconnectHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:26:13)
    at Socket.emit (events.Js:132:15)
    at Socket.emit (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:128:10)
    at Socket.onclose (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:425:8)
    at Socket.disconnect (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:453:10)
    at ChildProcess.workerExitHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:53:27)
    at ChildProcess.emit (events.Js:127:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.Js:209:12) Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.Js:596:16)
    at unbinDWorker (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:76:24)
    at Socket.socketdisconnectHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:26:13)
    at Socket.emit (events.Js:132:15)
    at Socket.emit (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:128:10)
    at Socket.onclose (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:425:8)
    at Socket.disconnect (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:453:10)
    at ChildProcess.workerExitHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:53:27)
    at ChildProcess.emit (events.Js:127:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.Js:209:12)
[2021-03-19 11:34:27.043] [ERROR] browser_service/index.Js - [MASTER: 16688] Uncaught exception:  Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.Js:596:16)
    at Socket.socketEventHandlers.(anonymous function) (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:67:28)
    at Socket.emit (events.Js:132:15)
    at Socket.emit (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:128:10)
    at Socket.onclose (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:425:8)
    at Socket.disconnect (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:453:10)
    at ChildProcess.workerExitHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:53:27)
    at ChildProcess.emit (events.Js:127:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.Js:209:12)
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.Js:596:16)
    at Socket.socketEventHandlers.(anonymous function) (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:67:28)
    at Socket.emit (events.Js:132:15)
    at Socket.emit (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:128:10)
    at Socket.onclose (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:425:8)
    at Socket.disconnect (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:453:10)
    at ChildProcess.workerExitHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:53:27)
    at ChildProcess.emit (events.Js:127:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.Js:209:12) Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.Js:596:16)
    at Socket.socketEventHandlers.(anonymous function) (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:67:28)
    at Socket.emit (events.Js:132:15)
    at Socket.emit (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:128:10)
    at Socket.onclose (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:425:8)
    at Socket.disconnect (/home/rando/Desktop/git/master-node/node/browser_service/node_modules/socket.io/lib/socket.Js:453:10)
    at ChildProcess.workerExitHandler (/home/rando/Desktop/git/master-node/node/browser_service/src/routes/session.Js:53:27)
    at ChildProcess.emit (events.Js:127:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.Js:209:12)

如果您能帮助我解决问题,我将不胜感激。


更新

据我所知,Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed 表示正在尝试向已关闭的进程发送消息。似乎工人死了,工人的消息exit:0 SIGSEGV

尚未找到解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

编程问答问答

在 CSS 中设置 cellpadding 和 cellspacing?
如何在 Java 中创建内存泄漏?
浮点数被破坏了吗?
按字符串属性值对对象数组进行排序
如何加快Android模拟器的速度?
如何舍入至多 2 位小数?
使用 Git 版本控制查看文件的更改历史记录
如何在 JavaScript 中检查空/未定义/空字符串?
微信公众号搜索 “ 程序精选 ” ,选择关注!
微信公众号搜 "程序精选"关注